Skip to content

Commit

Permalink
Adding Breadcrumb
Browse files Browse the repository at this point in the history
  • Loading branch information
AkramChauhan committed May 11, 2024
1 parent 37f92ab commit 7a1ba28
Show file tree
Hide file tree
Showing 25 changed files with 757 additions and 739 deletions.
12 changes: 12 additions & 0 deletions app/Console/Commands/stubs/module/controller.stub
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,31 @@ class {CONTROLLER_NAME} extends Controller {
'create_route' => route('admin.' . $this->handle_name_plural . '.create'),
'table_status' => 'all', //all , trashed
'all_count' => $all_count,
'module_names' => [
'singular' => $this->handle_name,
'plural' => $this->handle_name_plural,
],
'trashed_count' => $trashed_count,
]);
}
public function create() {
return kview($this->handle_name_plural . '.manage', [
'form_action' => route('admin.' . $this->handle_name_plural . '.store'),
'edit' => 0,
'module_names' => [
'singular' => $this->handle_name,
'plural' => $this->handle_name_plural,
],
]);
}
public function edit(Request $request) {
return kview($this->handle_name_plural . '.manage', [
'form_action' => route('admin.' . $this->handle_name_plural . '.update'),
'edit' => 1,
'module_names' => [
'singular' => $this->handle_name,
'plural' => $this->handle_name_plural,
],
'data' => Table::where('id', '=', $request->id)->first(),
]);
}
Expand Down
1 change: 1 addition & 0 deletions app/Console/Commands/stubs/module/views/index.stub
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ $page_number = 1;
?>
<div class="container page-container">
<div class="row justify-content-center">
@include($theme_name.'.layouts.partial.breadcrumb')
<div class="col-md-12">
@if ($errors->any())
<div class="alert alert-danger">
Expand Down
1 change: 1 addition & 0 deletions app/Console/Commands/stubs/module/views/manage.stub
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@section('content')
<div class="container page-container">
<div class="row justify-content-center">
@include($theme_name.'.layouts.partial.breadcrumb')
<div class="col-md-12">
@if ($errors->any())
<div class="alert alert-danger">
Expand Down
16 changes: 14 additions & 2 deletions app/Http/Controllers/Admin/ModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ public function index() {
'create_route' => route('admin.' . $this->handle_name_plural . '.create'),
'table_status' => 'all', //all , trashed
'all_count' => $all_count,
'module_names' => [
'singular' => $this->handle_name,
'plural' => $this->handle_name_plural,
],
'trashed_count' => $trashed_count,
]);
}
Expand All @@ -33,7 +37,11 @@ public function create() {
$form_action = route('admin.modules.store');
$col_types = getColumnTypes();
$edit = 0;
return kview($this->handle_name_plural . '.manage', compact('form_action', 'col_types', 'edit'));
$module_names = [
'singular' => $this->handle_name,
'plural' => $this->handle_name_plural,
];
return kview($this->handle_name_plural . '.manage', compact('form_action', 'module_names', 'col_types', 'edit'));
}

public function edit(Request $request) {
Expand All @@ -42,9 +50,13 @@ public function edit(Request $request) {
$col_types = getColumnTypes();
$data = Table::where('id', '=', $request->id)->first();
$edit = 0;
$module_names = [
'singular' => $this->handle_name,
'plural' => $this->handle_name_plural,
];
return kview(
$this->handle_name_plural . '.manage',
compact('form_action', 'col_types', 'data', 'edit')
compact('form_action', 'col_types', 'module_names', 'data', 'edit')
);
}

Expand Down

0 comments on commit 7a1ba28

Please sign in to comment.