From a703e063d1f1e81c190791078280b0b567713f09 Mon Sep 17 00:00:00 2001 From: Slymee Date: Tue, 26 Dec 2023 08:26:24 +0545 Subject: [PATCH] Admin dashboard layout editing: complete --- app/Http/Controllers/CategoryController.php | 3 +- .../views/backend/adminCategory.blade.php | 85 ++++++++--------- resources/views/backend/index.blade.php | 54 +++++------ .../layouts/dashboard-template.blade.php | 26 ++++++ .../commonComponents/bread-crumb.blade.php | 2 +- .../views/modals/adminAddCategory.blade.php | 91 +++++++++---------- 6 files changed, 133 insertions(+), 128 deletions(-) create mode 100644 resources/views/backend/layouts/dashboard-template.blade.php diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index 501ab5f..0feb9b8 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -12,7 +12,8 @@ class CategoryController extends Controller */ public function index() { - return view('backend.adminCategory'); + $datas = Category::whereNull('parent_id')->get(); + return view('backend.adminCategory', ['datas' => $datas]); } //Add Category Form diff --git a/resources/views/backend/adminCategory.blade.php b/resources/views/backend/adminCategory.blade.php index 3c2ad89..2f1a502 100644 --- a/resources/views/backend/adminCategory.blade.php +++ b/resources/views/backend/adminCategory.blade.php @@ -1,50 +1,43 @@ - - - - - - - - - - @vite(['resources/css/admin-dashboard.css', 'resources/css/side-nav.css', 'resources/css/admin-dashboard-category.css']) - Dashboard - Category - - -
-
- @include('commonComponents.side-nav') -
-
- @include('commonComponents.bread-crumb') -
- -
- Categories +@extends('backend.layouts.dashboard-template') + +@section('vite-resource') +@vite(['resources/css/admin-dashboard.css', 'resources/css/side-nav.css', 'resources/css/admin-dashboard-category.css']) +@endsection + +@section('page-title') + Dashboard-Category +@endsection + +@section('bread-crumb') + Dashboard/Category +@endsection + +@section('content') + +
+ Categories -
- - - - - - +
+
SNCategory NameUtilities
+ + + + + - - - - - - - + @foreach ($datas as $data) + + + + + + + + @endforeach -
SNCategory NameUtilities
1Fruit
{{ $data->id }}{{ $data->category_name }}
-
-
-
+
-
- - \ No newline at end of file + +@endsection \ No newline at end of file diff --git a/resources/views/backend/index.blade.php b/resources/views/backend/index.blade.php index a19dc3a..0c6909b 100644 --- a/resources/views/backend/index.blade.php +++ b/resources/views/backend/index.blade.php @@ -1,31 +1,23 @@ - - - - - - - - - - @vite(['resources/css/admin-dashboard.css', 'resources/css/side-nav.css']) - Dashboard - - -
-
- @include('commonComponents.side-nav') -
-
- @include('commonComponents.bread-crumb') -
-
-
asdasd
-
asdasd
-
asdasd
-
asdasd
-
-
-
-
- - \ No newline at end of file +@extends('backend.layouts.dashboard-template') + + +@section('vite-resource') +@vite(['resources/css/admin-dashboard.css', 'resources/css/side-nav.css']) +@endsection + +@section('page-title') + Dashboard +@endsection + +@section('bread-crumb') + Dashboard +@endsection + +@section('content') +
+
asdasd
+
asdasd
+
asdasd
+
asdasd
+
+@endsection \ No newline at end of file diff --git a/resources/views/backend/layouts/dashboard-template.blade.php b/resources/views/backend/layouts/dashboard-template.blade.php new file mode 100644 index 0000000..38cdac8 --- /dev/null +++ b/resources/views/backend/layouts/dashboard-template.blade.php @@ -0,0 +1,26 @@ + + + + + + + + + + @yield('vite-resource') + @yield('page-title') + + +
+
+ @include('commonComponents.side-nav') +
+
+ @include('commonComponents.bread-crumb') +
+ @yield('content') +
+
+
+ + \ No newline at end of file diff --git a/resources/views/commonComponents/bread-crumb.blade.php b/resources/views/commonComponents/bread-crumb.blade.php index ab1b6b8..d282dc4 100644 --- a/resources/views/commonComponents/bread-crumb.blade.php +++ b/resources/views/commonComponents/bread-crumb.blade.php @@ -1,4 +1,4 @@ \ No newline at end of file diff --git a/resources/views/modals/adminAddCategory.blade.php b/resources/views/modals/adminAddCategory.blade.php index 17f5df4..d007548 100644 --- a/resources/views/modals/adminAddCategory.blade.php +++ b/resources/views/modals/adminAddCategory.blade.php @@ -1,49 +1,42 @@ - - - - - - - - - - @vite(['resources/css/admin-dashboard.css', 'resources/css/side-nav.css', 'resources/css/admin-dashboard-category.css']) - Dashboard - Add Category - - -
-
- @include('commonComponents.side-nav') -
-
- @include('commonComponents.bread-crumb') -
-
- Add a Category -
- @csrf -
-
- - - - - - @if (session('message')) - Category Inserted - @endif - -
-
-
-
-
- - \ No newline at end of file +@extends('backend.layouts.dashboard-template') + +@section('vite-resource') +@vite(['resources/css/admin-dashboard.css', 'resources/css/side-nav.css', 'resources/css/admin-dashboard-category.css']) +@endsection + +@section('page-title') + Dashboard-Add Category +@endsection + +@section('bread-crumb') + Dashboard/Category/AddCategory +@endsection + +@section('content') +
+ Add a Category +
+ @csrf +
+
+ + + + + + @if (session('message')) + Category Inserted + @endif + +
+
+@endsection + + \ No newline at end of file