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

@@ -46,7 +46,7 @@ class ArticleController extends Controller
// checking authentication
$this->middleware('auth');
// checking roles
$this->middleware('roles');
$this->middleware('role.agent');
SettingsController::language();
}

View File

@@ -40,7 +40,7 @@ class CategoryController extends Controller
// checking authentication
$this->middleware('auth');
// checking roles
$this->middleware('roles');
$this->middleware('role.agent');
SettingsController::language();
}

View File

@@ -38,7 +38,7 @@ class PageController extends Controller
// checking authentication
$this->middleware('auth');
// checking roles
$this->middleware('roles');
$this->middleware('role.agent');
$this->page = $page;
SettingsController::language();
}
@@ -86,7 +86,7 @@ class PageController extends Controller
/* add column Actions */
/* there are action buttons and modal popup to delete a data column */
->addColumn('Actions', function ($model) {
return '<span data-toggle="modal" data-target="#deletepage'.$model->id.'"><a href="#" ><button class="btn btn-danger btn-xs"></a> '.\Lang::get('lang.delete').'</button></span>&nbsp;<a href=page/'.$model->slug.'/edit class="btn btn-warning btn-xs">'.\Lang::get('lang.edit').'</a>&nbsp;<a href=pages/'.$model->slug.' class="btn btn-primary btn-xs">'.\Lang::get('lang.view').'</a>
return '<span data-toggle="modal" data-target="#deletepage'.$model->id.'"><a href="#" ><button class="btn btn-danger btn-xs"></a> '.\Lang::get('lang.delete').'</button></span>&nbsp;<a href=page/'.$model->id.'/edit class="btn btn-warning btn-xs">'.\Lang::get('lang.edit').'</a>&nbsp;<a href=pages/'.$model->slug.' class="btn btn-primary btn-xs">'.\Lang::get('lang.view').'</a>
<div class="modal fade" id="deletepage'.$model->id.'">
<div class="modal-dialog">
<div class="modal-content">
@@ -150,7 +150,7 @@ class PageController extends Controller
public function edit($slug)
{
try {
$page = $this->page->where('slug', $slug)->first();
$page = $this->page->where('id', $slug)->first();
return view('themes.default1.agent.kb.pages.edit', compact('page'));
} catch (Exception $e) {
@@ -169,7 +169,7 @@ class PageController extends Controller
public function update($slug, PageRequest $request)
{
// get pages with respect to slug
$pages = $this->page->where('slug', $slug)->first();
$pages = $this->page->where('id', $slug)->first();
$sl = $request->input('name');
$slug = Str::slug($sl, '-');

View File

@@ -42,7 +42,7 @@ class SettingsController extends Controller
// checking authentication
$this->middleware('auth');
// checking roles
$this->middleware('roles');
$this->middleware('role.agent');
$this->language();
}