diff --git a/app/Console/Commands/formblade.dat b/app/Console/Commands/formblade.dat new file mode 100644 index 0000000..f58f08a --- /dev/null +++ b/app/Console/Commands/formblade.dat @@ -0,0 +1,42 @@ +@extends('admin.templates.panel-form-template') +@section('title') + @if(isset($item)) + {{__("Edit user")}} [{{$item->id}}] + @else + {{__("Add new user")}} + @endif - +@endsection +@section('form') + +
+
+ + @include('components.err') +
+

+ + {{__("Tips")}} +

+
    +
  • + {{__("Recommends")}} +
  • +
+
+ +
+
+
+ +

+ @if(isset($item)) + {{__("Edit user")}} [{{$item->id}}] + @else + {{__("Add new user")}} + @endif +

+ +
+
+
+@endsection diff --git a/app/Console/Commands/listblade.dat b/app/Console/Commands/listblade.dat new file mode 100644 index 0000000..5313f0c --- /dev/null +++ b/app/Console/Commands/listblade.dat @@ -0,0 +1,15 @@ +@extends('admin.templates.panel-list-template') + +@section('list-title') + + {{__("Users list")}} +@endsection +@section('title') + {{__("Users list")}} - +@endsection +@section('filter') + {{-- Other filters --}} +@endsection +@section('bulk') + {{-- --}} +@endsection diff --git a/app/Console/Commands/makeXcontroller.php b/app/Console/Commands/makeXcontroller.php index fddf9d7..7ec3e90 100644 --- a/app/Console/Commands/makeXcontroller.php +++ b/app/Console/Commands/makeXcontroller.php @@ -4,6 +4,8 @@ namespace App\Console\Commands; use Illuminate\Console\Command; use Illuminate\Support\Facades\Artisan; +use Illuminate\Support\Str; +use Illuminate\Support\Facades\File; class makeXcontroller extends Command { @@ -30,15 +32,21 @@ class makeXcontroller extends Command $model = ucfirst($this->argument('model')); $var = '$' . strtolower($this->argument('model')); + $plural = Str::plural($model); + // check model exists if (!file_exists(__DIR__.'/../../Models/'.$model.'.php')){ $this->error("Model not found!"); return ; } + // get controller content $content = file_get_contents(__DIR__ . '/xcontroller.dat'); + // replace variables $content = str_replace('User', $model, $content); + $content = str_replace('user', strtolower($model), $content); + $content = str_replace('users', strtolower($plural), $content); $content = str_replace('$user', $var, $content); Artisan::call('make:request', ['name' => $model.'SaveRequest']); @@ -47,6 +55,7 @@ class makeXcontroller extends Command $model_content = file_get_contents(__DIR__.'/../../Models/'.$model.'.php'); + // check soft delete for restore if (!strpos($model_content,'SoftDeletes')){ $pattern = '/\/\*\*restore\*\/(.*?)\/\*restore\*\*\//s'; $replacement = ''; @@ -56,6 +65,30 @@ class makeXcontroller extends Command $this->info('Admin/' . $model . 'Controller created'); $this->info( $model.'SaveRequest created'); + $folderPath = resource_path('views/admin/'.strtolower($plural)); + + // create view folder + if (!File::exists($folderPath)) { + File::makeDirectory($folderPath); + $this->info('Folder created successfully.'); + } else { + $this->info('Folder already exists.'); + } + + // make list blade + $model = strtolower($model); + $content = file_get_contents(__DIR__ . '/listblade.dat'); + $content = str_replace('Users',$plural,$content); + file_put_contents($folderPath.'/'.$model.'-list.blade.php',$content); + $this->info($model.'-list.blade.php created'); + + // make form blade + $content = file_get_contents(__DIR__ . '/formblade.dat'); + $content = str_replace('Users',$plural,$content); + $content = str_replace('user',strtolower($model),$content); + file_put_contents($folderPath.'/'.$model.'-form.blade.php',$content); + $this->info($model.'-form.blade.php created'); + } } diff --git a/app/Console/Commands/xcontroller.dat b/app/Console/Commands/xcontroller.dat index ce388ac..6a2a83c 100644 --- a/app/Console/Commands/xcontroller.dat +++ b/app/Console/Commands/xcontroller.dat @@ -13,12 +13,18 @@ use function App\Helpers\hasCreateRoute; class UserController extends XController { + + // protected $_MODEL_ = User::class; + // protected $SAVE_REQUEST = UserSaveRequest::class; + protected $cols = []; + protected $extra_cols = []; protected $searchable = []; + protected $listView = 'admin.users.user-list'; + protected $formView = 'admin.users.user-form'; - protected const request = UserSaveRequest::class; protected $buttons = [ 'edit' => @@ -29,6 +35,17 @@ class UserController extends XController ['title' => "Remove", 'class' => 'btn-outline-danger delete-confirm', 'icon' => 'ri-close-line'], ]; + + public function __construct() + { + parent::__construct(User::class, UserSaveRequest::class); + } + + /** + * @param $user User + * @param $request UserSaveRequest + * @return User + */ public function save($user, $request) { @@ -66,13 +83,13 @@ class UserController extends XController switch ($action) { case 'delete': $msg = __(':COUNT items deleted successfully', ['COUNT' => count($ids)]); - self::_MODEL_::destroy($ids); + $this->_MODEL_::destroy($ids); break; /**restore*/ case 'restore': $msg = __(':COUNT items restored successfully', ['COUNT' => count($ids)]); foreach ($ids as $id) { - self::_MODEL_::withTrashed()->find($id)->restore(); + $this->_MODEL_::withTrashed()->find($id)->restore(); } break; /*restore**/ diff --git a/app/Helpers/Helper.php b/app/Helpers/Helper.php index 09d77a4..7059c0d 100644 --- a/app/Helpers/Helper.php +++ b/app/Helpers/Helper.php @@ -210,8 +210,11 @@ function logAdmin($method, $cls, $id) :void } - - +/** + * build query with excepts + * @param $except + * @return string + */ function queryBuilder($except = null){ $queries = request()->toArray(); if ($except != null){ @@ -220,3 +223,37 @@ function queryBuilder($except = null){ } return http_build_query($queries); } + + +/** + * @param $name + * @param $replace_char string + * @return string + */ +function sluger($name, $replace_char = '-') +{ + // special chars + $name = str_replace(['&', '+' , '@', '*'], ['and', 'plus', 'at', 'star'], $name); + + // replace non letter or digits by - + $name = preg_replace('~[^\pL\d\.]+~u', $replace_char, $name); + + // transliterate + $name = iconv('utf-8', 'utf-8//TRANSLIT', $name); + + // trim + $name = trim($name, $replace_char); + + // remove duplicate - + $name = preg_replace('~-+~', $replace_char, $name); + + // lowercase + $name = strtolower($name); + + if (empty($name)) { + return 'N-A'; + } + + return substr($name, 0, 120); +} + diff --git a/app/Http/Controllers/Admin/GroupController.php b/app/Http/Controllers/Admin/GroupController.php new file mode 100644 index 0000000..0329d59 --- /dev/null +++ b/app/Http/Controllers/Admin/GroupController.php @@ -0,0 +1,133 @@ + + ['title' => "Edit", 'class' => 'btn-outline-primary', 'icon' => 'ri-edit-2-line'], + 'show' => + ['title' => "Detail", 'class' => 'btn-outline-light', 'icon' => 'ri-eye-line'], + 'destroy' => + ['title' => "Remove", 'class' => 'btn-outline-danger delete-confirm', 'icon' => 'ri-close-line'], + ]; + + + public function __construct() + { + parent::__construct(Group::class, GroupSaveRequest::class); + } + + /** + * @param $group Group + * @param $request GroupSaveRequest + * @return Group + */ + public function save($group, $request) + { + + $group->name = $request->input('name'); + $group->subtitle = $request->input('subtitle'); + $group->description = $request->input('description'); + $group->parent_id = $request->input('parent_id'); + $group->slug = $this->getSlug($group); + if ($request->has('image')){ + $group->image = $this->storeFile('image',$group, 'groups'); + } + if ($request->has('bg')){ + $group->bg = $this->storeFile('bg',$group, 'groups'); + } + $group->save(); + return $group; + + } + + + /** + * Show the form for creating a new resource. + */ + public function create() + { + // + $cats = Group::all(); + return view($this->formView,compact('cats')); + } + + /** + * Show the form for editing the specified resource. + */ + public function edit(Group $item) + { + // + $cats = Group::all(); + return view($this->formView, compact('item','cats')); + } + + public function bulk(Request $request) + { + +// dd($request->all()); + $data = explode('.', $request->input('action')); + $action = $data[0]; + $ids = $request->input('id'); + switch ($action) { + case 'delete': + $msg = __(':COUNT items deleted successfully', ['COUNT' => count($ids)]); + $this->_MODEL_::destroy($ids); + break; + /**restore*/ + case 'restore': + $msg = __(':COUNT items restored successfully', ['COUNT' => count($ids)]); + foreach ($ids as $id) { + $this->_MODEL_::withTrashed()->find($id)->restore(); + } + break; + /*restore**/ + default: + $msg = __('Unknown bulk action : :ACTION', ["ACTION" => $action]); + } + + return $this->do_bulk($msg, $action, $ids); + } + + public function destroy(Group $item) + { + return parent::delete($item); + } + + + public function update(Request $request, Group $item) + { + return $this->bringUp($request, $item); + } + + /**restore*/ + public function restore($item) + { + return parent::restoreing(Group::withTrashed()->where('id', $item)->first()); + } + /*restore**/ +} diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index 64d1d0a..c286825 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -93,12 +93,12 @@ class UserController extends XController switch ($action) { case 'delete': $msg = __(':COUNT items deleted successfully', ['COUNT' => count($ids)]); - self::_MODEL_::destroy($ids); + $this->_MODEL_::destroy($ids); break; case 'restore': $msg = __(':COUNT items restored successfully', ['COUNT' => count($ids)]); foreach ($ids as $id) { - self::_MODEL_::withTrashed()->find($id)->restore(); + $this->_MODEL_::withTrashed()->find($id)->restore(); } break; case 'role': diff --git a/app/Http/Controllers/XController.php b/app/Http/Controllers/XController.php index 707089b..4fb0a56 100644 --- a/app/Http/Controllers/XController.php +++ b/app/Http/Controllers/XController.php @@ -4,13 +4,14 @@ namespace App\Http\Controllers; use App\Http\Requests\UserSaveRequest; use App\Models\User; +use Illuminate\Database\Eloquent\Model; use Illuminate\Http\Request; abstract class XController extends Controller { - protected const _MODEL_ = User::class; - protected const SAVE_REQUEST = UserSaveRequest::class; + protected $_MODEL_ = User::class; + protected $SAVE_REQUEST = UserSaveRequest::class; protected $cols = []; protected $extra_cols = ['id']; protected $listView = 'admin.users.user-list'; @@ -18,6 +19,16 @@ abstract class XController extends Controller protected $searchable = []; + public function __construct($model = null, $request = null) + { + if ($model != null) { + $this->_MODEL_ = $model; + } + if ($request != null) { + $this->SAVE_REQUEST = $request; + } + } + protected $buttons = [ 'edit' => @@ -51,9 +62,9 @@ abstract class XController extends Controller if (!\request()->has('sort') || !in_array(\request('sort'), $this->cols)) { - $query = self::_MODEL_::orderByDesc('id'); + $query = $this->_MODEL_::orderByDesc('id'); } else { - $query = self::_MODEL_::orderBy(\request('sort'), \request('sortType', 'asc')); + $query = $this->_MODEL_::orderBy(\request('sort'), \request('sortType', 'asc')); } foreach (\request()->input('filter', []) as $col => $filter) { @@ -95,7 +106,6 @@ abstract class XController extends Controller } - /** * Store a newly created resource in storage. */ @@ -103,11 +113,11 @@ abstract class XController extends Controller { // - $validatedRequest = app()->make(self::SAVE_REQUEST)->merge($request->all()); + $validatedRequest = app()->make($this->SAVE_REQUEST)->merge($request->all()); - $item = new (self::_MODEL_)(); + $item = new ($this->_MODEL_)(); $item = $this->save($item, $request); - logAdmin(__METHOD__, self::_MODEL_, $item->id); + logAdmin(__METHOD__, $this->_MODEL_, $item->id); if ($request->ajax()) { return ['OK' => true, __('As you wished created successfully')]; @@ -133,9 +143,9 @@ abstract class XController extends Controller { // - $validatedRequest = app()->make(self::SAVE_REQUEST)->merge($request->all()); + $validatedRequest = app()->make($this->SAVE_REQUEST)->merge($request->all()); $item = $this->save($item, $request); - logAdmin(__METHOD__, self::_MODEL_, $item->id); + logAdmin(__METHOD__, $this->_MODEL_, $item->id); if ($request->ajax()) { return ['OK' => true, __('As you wished updated successfully')]; @@ -151,7 +161,7 @@ abstract class XController extends Controller public function delete($item) { // - logAdmin(__METHOD__, self::_MODEL_, $item->id); + logAdmin(__METHOD__, $this->_MODEL_, $item->id); $item->delete(); return redirect()->back()->with(['message' => __('As you wished removed successfully')]); } @@ -162,7 +172,7 @@ abstract class XController extends Controller public function restoreing($item) { // - logAdmin(__METHOD__, self::_MODEL_, $item->id); + logAdmin(__METHOD__, $this->_MODEL_, $item->id); $item->restore(); return redirect()->back()->with(['message' => __('As you wished restored successfully')]); } @@ -177,11 +187,48 @@ abstract class XController extends Controller return $this->showList($query); } + /** + * do bulk actions + * @param $msg + * @param $action + * @param $ids + * @return \Illuminate\Http\RedirectResponse + */ protected function do_bulk($msg, $action, $ids) { - logAdminBatch(__METHOD__ . '.' . $action, self::_MODEL_, $ids); + logAdminBatch(__METHOD__ . '.' . $action, $this->_MODEL_, $ids); return redirect()->back()->with(['message' => $msg]); } + /** + * @param $key request key as column's name + * @param $model Model + * @param $folder string save directory name + * @return string|null + */ + public function storeFile($key, $model, $folder) + { + if (\request()->hasFile($key)) { + $name = time() . '-' . request()->file($key)->getClientOriginalName() ; + request()->file($key)->storeAs('public/' . $folder, $name); + return $name; + } + return null; + } + + /** + * @param $model Model + * @param $key string key of slug request + * @param $name base slug col + * @return void + */ + public function getSlug($model, $key = 'slug', $name = 'name') + { + if (!\request()->has('slug') || request()->input('slug') == null) { + return sluger($model->$name); + } else { + return sluger(\request()->input($key, $model->$name)); + } + } } diff --git a/app/Http/Requests/GroupSaveRequest.php b/app/Http/Requests/GroupSaveRequest.php new file mode 100644 index 0000000..35fcd94 --- /dev/null +++ b/app/Http/Requests/GroupSaveRequest.php @@ -0,0 +1,33 @@ +check(); + } + + /** + * Get the validation rules that apply to the request. + * + * @return array|string> + */ + public function rules(): array + { + return [ + 'name' => ['required', 'string', 'min:2', 'max:128'], + 'subtitle' => ['nullable', 'string',], + 'image' => ['nullable', 'file', 'mimes:jpg,svg,png'], + 'bg' => ['nullable', 'file', 'mimes:jpg,svg,png'], + 'description' => ['nullable', 'string',], + 'parent_id' => ['nullable', 'exists:groups,id'], + ]; + } +} diff --git a/app/Models/Category.php b/app/Models/Category.php index c9d6222..de10cea 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -8,4 +8,21 @@ use Illuminate\Database\Eloquent\Model; class Category extends Model { use HasFactory; + + public function imgUrl() + { + if ($this->image == null) { + return null; + } + + return \Storage::url('category/' . $this->image); + } + public function bgUrl() + { + if ($this->bg == null) { + return null; + } + + return \Storage::url('category/' . $this->bg); + } } diff --git a/app/Models/Group.php b/app/Models/Group.php index 00274a8..c05c5aa 100644 --- a/app/Models/Group.php +++ b/app/Models/Group.php @@ -6,14 +6,12 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; use Spatie\Translatable\HasTranslations; -use Xmen\StarterKit\Models\Category; -use Xmen\StarterKit\Models\Post; class Group extends Model { use HasFactory, SoftDeletes,HasTranslations; - public $translatable = ['name','description']; + public $translatable = ['name','subtitle','description']; public function posts() { return $this->belongsToMany(Post::class); @@ -22,12 +20,12 @@ class Group extends Model // public function parent() { - return $this->belongsTo(Category::class, 'parent_id'); + return $this->belongsTo(Group::class, 'parent_id'); } public function children() { - return $this->hasMany(Category::class, 'parent_id'); + return $this->hasMany(Group::class, 'parent_id'); } public function getRouteKeyName() @@ -39,4 +37,22 @@ class Group extends Model { return $this->belongsTo(\App\Models\User::class); } + + public function imgUrl() + { + if ($this->image == null) { + return null; + } + + return \Storage::url('groups/' . $this->image); + } + + public function bgUrl() + { + if ($this->bg == null) { + return null; + } + + return \Storage::url('groups/' . $this->bg); + } } diff --git a/database/migrations/2024_05_07_123332_create_groups_table.php b/database/migrations/2024_05_07_123332_create_groups_table.php index e8e6049..2c3a4e3 100644 --- a/database/migrations/2024_05_07_123332_create_groups_table.php +++ b/database/migrations/2024_05_07_123332_create_groups_table.php @@ -15,7 +15,10 @@ return new class extends Migration $table->id(); $table->text('name'); $table->string('slug', 128)->unique(); + $table->text('subtitle')->nullable(); $table->text('description')->nullable(); + $table->string('image', 2048)->nullable(); + $table->string('bg', 2048)->nullable(); $table->integer('sort')->default(0); $table->unsignedInteger('parent_id')->nullable()->default(null)->index(); $table->softDeletes(); diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 0e46ac4..11045ec 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -1,7 +1,9 @@ create(); - $this->call( - UserSeeder::class, + $this->call([ + + UserSeeder::class, + GroupSeeder::class + ] ); } } diff --git a/database/seeders/GroupSeeder.php b/database/seeders/GroupSeeder.php index 1e72ffd..214e8c1 100644 --- a/database/seeders/GroupSeeder.php +++ b/database/seeders/GroupSeeder.php @@ -2,6 +2,7 @@ namespace Database\Seeders; +use App\Models\Group; use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Database\Seeder; @@ -13,5 +14,21 @@ class GroupSeeder extends Seeder public function run(): void { // + $g1 = new Group(); + $g1->name = __("News"); + $g1->slug = 'news'; + $g1->subtitle = __("All news about your e-commerce will be provided."); + $g1->save(); + + $g2 = new Group(); + $g2->name = __("Articles"); + $g2->subtitle = __("All articles about your e-commerce will be provided."); + $g2->slug = 'articles'; + $g2->save(); + + $g3 = new Group(); + $g3->name = __("About us"); + $g3->slug = 'about-us'; + $g3->save(); } } diff --git a/resources/views/admin/groups/group-form.blade.php b/resources/views/admin/groups/group-form.blade.php new file mode 100644 index 0000000..bd34d1f --- /dev/null +++ b/resources/views/admin/groups/group-form.blade.php @@ -0,0 +1,137 @@ +@extends('admin.templates.panel-form-template') +@section('title') + @if(isset($item)) + {{__("Edit group")}} [{{$item->name}}] + @else + {{__("Add new group")}} + @endif - +@endsection +@section('form') + +
+
+ @include('components.err') +
+

+ + {{__("Tips")}} +

+
    +
  • + {{__("You can leave the slug empty; it will be generated automatically.")}} +
  • +
+
+ + @if(isset($item)) +
+

+ + {{__('Feature image')}} +

+ {{$item->name}} + +
+
+

+ + {{__('Background image')}} +

+ {{$item->name}} + +
+ @endif + + +
+
+
+ +

+ @if(isset($item)) + {{__("Edit group")}} [{{$item->name}}] + @else + {{__("Add new group")}} + @endif +

+ +
+
+ + +
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+
+ + +
+
+ +
+ + +
+
+ + +
+
+
+
+
+@endsection diff --git a/resources/views/admin/groups/group-list.blade.php b/resources/views/admin/groups/group-list.blade.php new file mode 100644 index 0000000..dc130cc --- /dev/null +++ b/resources/views/admin/groups/group-list.blade.php @@ -0,0 +1,15 @@ +@extends('admin.templates.panel-list-template') + +@section('list-title') + + {{__("Groups list")}} +@endsection +@section('title') + {{__("Groups list")}} - +@endsection +@section('filter') + {{-- Other filters --}} +@endsection +@section('bulk') + {{-- --}} +@endsection diff --git a/resources/views/admin/templates/panel-list-template.blade.php b/resources/views/admin/templates/panel-list-template.blade.php index a876640..916ace2 100644 --- a/resources/views/admin/templates/panel-list-template.blade.php +++ b/resources/views/admin/templates/panel-list-template.blade.php @@ -6,6 +6,7 @@ {{-- list side bar start--}}
+ @include('components.err')
@@ -79,9 +80,9 @@ @@ -95,7 +96,7 @@
@endif - @include('components.err') +
{{-- list side bar end--}} @@ -132,103 +133,120 @@ - @foreach($items as $item) + @if(count($items) == 0) - - - + + {{__("There is nothing to show!")}} - @foreach($cols as $k => $col) - @if($k == 0 && hasRoute('edit')) - - - - {{$item->name}} - - - - @else - - {{$item->$col}} - - @endif - @endforeach - @yield('table-body') - + + @else + @foreach($items as $item) + + + + + + @foreach($cols as $k => $col) + @if($k == 0 && hasRoute('edit')) + + + + {{$item->name}} + + + + @else + + @switch($col) + @case($col == 'parent_id') + {{ $item->parent?->{$cols[0]}??'-' }} + @break + @default + {{$item->$col}} + @endswitch + + @endif + @endforeach + @yield('table-body') + - @if(strpos(request()->url(),'trashed') != false && hasRoute('restore')) - - - - @else + @if(strpos(request()->url(),'trashed') != false && hasRoute('restore')) + + + + @else - - @endif -
- @foreach($buttons as $btn => $btnData) - @if(strpos($btnData['class'],'delete') == false ) - @if(strpos(request()->url(),'trashed') == false) + @if(strpos($btnData['class'],'delete') == false ) + @if(strpos(request()->url(),'trashed') == false) - - - - @endif - @else - @if( hasRoute('restore') && $item->trashed()) - - - + + + + @endif @else - - - + @if( hasRoute('restore') && $item->trashed()) + + + + @else + + + + @endif @endif - @endif - @endforeach -
- - - @endforeach + @endforeach +
+ + + + @endforeach + @endif + diff --git a/resources/views/admin/users/user-form.blade.php b/resources/views/admin/users/user-form.blade.php index ff5c0f3..46227e1 100644 --- a/resources/views/admin/users/user-form.blade.php +++ b/resources/views/admin/users/user-form.blade.php @@ -11,6 +11,8 @@
+ @include('components.err') +

{{__("Tips")}} @@ -25,7 +27,6 @@

- @include('components.err')
diff --git a/resources/views/components/panel-side-navbar.blade.php b/resources/views/components/panel-side-navbar.blade.php index a427172..9ceee6e 100644 --- a/resources/views/components/panel-side-navbar.blade.php +++ b/resources/views/components/panel-side-navbar.blade.php @@ -79,7 +79,7 @@
  • - + {{__('Groups')}} diff --git a/routes/web.php b/routes/web.php index e061ccd..9e4de0f 100644 --- a/routes/web.php +++ b/routes/web.php @@ -33,17 +33,17 @@ Route::prefix(config('app.panel.prefix'))->name('admin.')->group( Route::post('bulk', [\App\Http\Controllers\Admin\UserController::class, "bulk"])->name('bulk'); Route::get('trashed', [\App\Http\Controllers\Admin\UserController::class, "trashed"])->name('trashed'); }); - Route::prefix('group')->name('group.')->group( + Route::prefix('groups')->name('group.')->group( function () { - Route::get('', [\App\Http\Controllers\Admin\UserController::class, 'index'])->name('index'); - Route::get('create', [\App\Http\Controllers\Admin\UserController::class, 'create'])->name('create'); - Route::post('store', [\App\Http\Controllers\Admin\UserController::class, 'store'])->name('store'); - Route::get('edit/{item}', [\App\Http\Controllers\Admin\UserController::class, 'edit'])->name('edit'); - Route::post('update/{item}', [\App\Http\Controllers\Admin\UserController::class, 'update'])->name('update'); - Route::get('delete/{item}', [\App\Http\Controllers\Admin\UserController::class, 'destroy'])->name('destroy'); - Route::get('restore/{item}', [\App\Http\Controllers\Admin\UserController::class, 'restore'])->name('restore'); - Route::post('bulk', [\App\Http\Controllers\Admin\UserController::class, "bulk"])->name('bulk'); - Route::get('trashed', [\App\Http\Controllers\Admin\UserController::class, "trashed"])->name('trashed'); + Route::get('', [\App\Http\Controllers\Admin\GroupController::class, 'index'])->name('index'); + Route::get('create', [\App\Http\Controllers\Admin\GroupController::class, 'create'])->name('create'); + Route::post('store', [\App\Http\Controllers\Admin\GroupController::class, 'store'])->name('store'); + Route::get('edit/{item}', [\App\Http\Controllers\Admin\GroupController::class, 'edit'])->name('edit'); + Route::post('update/{item}', [\App\Http\Controllers\Admin\GroupController::class, 'update'])->name('update'); + Route::get('delete/{item}', [\App\Http\Controllers\Admin\GroupController::class, 'destroy'])->name('destroy'); + Route::get('restore/{item}', [\App\Http\Controllers\Admin\GroupController::class, 'restore'])->name('restore'); + Route::post('bulk', [\App\Http\Controllers\Admin\GroupController::class, "bulk"])->name('bulk'); + Route::get('trashed', [\App\Http\Controllers\Admin\GroupController::class, "trashed"])->name('trashed'); }); }); });