This commit is contained in:
KNaveenraj-ladybird
2023-10-09 12:44:24 +05:30
parent aa4b3d2990
commit 5f9e3803ad
15 changed files with 751 additions and 36 deletions

View File

@@ -35,7 +35,7 @@ class="nav-item menu-open"
@section('content')
{!! Form::model($page,['url' => 'page/'.$page->slug, 'method' => 'PATCH','files'=>true]) !!}
{!! Form::model($page,['url' => 'page/'.$page->id, 'method' => 'PATCH','files'=>true]) !!}
@if(Session::has('errors'))
<?php //dd($errors); ?>
@@ -130,7 +130,7 @@ class="nav-item menu-open"
</div>
<div class="card-footer">
{!! Form::submit(Lang::get('lang.publish'),['class'=>'btn btn-primary'])!!}
</div>
</div>

View File

@@ -254,9 +254,22 @@ $category_id = $all->pluck('category_id')->toArray();
$(".form-group").removeClass("has-error");
// Perform your custom validation here
var name = $("#comment-name").val().trim();
var email = $("#comment-email").val().trim();
var comment = $("#comment-comment").val().trim();
var nameElement = $("#comment-name");
var emailElement = $("#comment-email");
var commentElement = $("#comment-comment");
if (nameElement.length > 0) {
var name = nameElement.val().trim();
}
if (emailElement.length > 0) {
var email = emailElement.val().trim();
}
if (commentElement.length > 0) {
var comment = commentElement.val().trim();
}
// Flag to track if there are any errors
var hasErrors = false;

View File

@@ -160,7 +160,11 @@
</ul>
</li>
<?php $pages = App\Model\kb\Page::where('status', '1')->where('visibility', '1')->get();
<?php
if(!Auth::check() || Auth::user()->role == 'user')
$pages = App\Model\kb\Page::where('status', '1')->where('visibility', '1')->get();
else
$pages = App\Model\kb\Page::where('status', '1')->get();
?>
@if(count($pages))
<li @yield('pages') class="nav-item dropdown">