added Group

added some essential function to helper and xcontoller
pull/44/head
A1Gard 7 months ago
parent c7f582ed46
commit 970dfd0795

@ -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')
<div class="row">
<div class="col-lg-3">
@include('components.err')
<div class="item-list mb-3">
<h3 class="p-3">
<i class="ri-message-3-line"></i>
{{__("Tips")}}
</h3>
<ul>
<li>
{{__("Recommends")}}
</li>
</ul>
</div>
</div>
<div class="col-lg-9 ps-xl-1 ps-xxl-1">
<div class="general-form ">
<h1>
@if(isset($item))
{{__("Edit user")}} [{{$item->id}}]
@else
{{__("Add new user")}}
@endif
</h1>
</div>
</div>
</div>
@endsection

@ -0,0 +1,15 @@
@extends('admin.templates.panel-list-template')
@section('list-title')
<i class="ri-user-3-line"></i>
{{__("Users list")}}
@endsection
@section('title')
{{__("Users list")}} -
@endsection
@section('filter')
{{-- Other filters --}}
@endsection
@section('bulk')
{{-- <option value="-"> - </option> --}}
@endsection

@ -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');
}
}

@ -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**/

@ -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);
}

@ -0,0 +1,133 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Http\Controllers\XController;
use App\Http\Requests\GroupSaveRequest;
use App\Models\Access;
use App\Models\Group;
use Illuminate\Http\Request;
use App\Helper;
use function App\Helpers\hasCreateRoute;
class GroupController extends XController
{
// protected $_MODEL_ = Group::class;
// protected $SAVE_REQUEST = GroupSaveRequest::class;
protected $cols = ['name','subtitle','parent_id'];
protected $extra_cols = ['id','slug'];
protected $searchable = ['name','subtitle','description'];
protected $listView = 'admin.groups.group-list';
protected $formView = 'admin.groups.group-form';
protected $buttons = [
'edit' =>
['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**/
}

@ -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':

@ -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));
}
}
}

@ -0,0 +1,33 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class GroupSaveRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return auth()->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|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'],
];
}
}

@ -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);
}
}

@ -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);
}
}

@ -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();

@ -1,7 +1,9 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
class DatabaseSeeder extends Seeder
@ -13,8 +15,11 @@ class DatabaseSeeder extends Seeder
{
// User::factory(10)->create();
$this->call(
$this->call([
UserSeeder::class,
GroupSeeder::class
]
);
}
}

@ -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();
}
}

@ -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')
<div class="row">
<div class="col-lg-3">
@include('components.err')
<div class="item-list mb-3">
<h3 class="p-3">
<i class="ri-message-3-line"></i>
{{__("Tips")}}
</h3>
<ul>
<li>
{{__("You can leave the slug empty; it will be generated automatically.")}}
</li>
</ul>
</div>
@if(isset($item))
<div class="item-list mb-3">
<h3 class="p-3">
<i class="ri-image-2-line"></i>
{{__('Feature image')}}
</h3>
<img src="{{$item->imgUrl()}}" alt="{{$item->name}}" class="img-fluid">
</div>
<div class="item-list mb-3">
<h3 class="p-3">
<i class="ri-image-2-line"></i>
{{__('Background image')}}
</h3>
<img src="{{$item->bgUrl()}}" alt="{{$item->name}}" class="img-fluid">
</div>
@endif
</div>
<div class="col-lg-9 ps-xl-1 ps-xxl-1">
<div class="general-form ">
<h1>
@if(isset($item))
{{__("Edit group")}} [{{$item->name}}]
@else
{{__("Add new group")}}
@endif
</h1>
<div class="form-group row">
<div class="col-md-6 mt-3">
<label for="name">
{{__('Category name')}}
</label>
<input name="name" type="text" class="form-control @error('name') is-invalid @enderror"
placeholder="{{__('Group name')}}" value="{{old('name',$item->name??null)}}"/>
</div>
<div class="col-md-6 mt-3">
<label for="name">
{{__('Category slug')}}
</label>
<input name="slug" type="text" class="form-control @error('slug') is-invalid @enderror"
placeholder="{{__('Group slug')}}" value="{{old('slug',$item->slug??null)}}"/>
</div>
<div class="col-md-12 mt-3">
<div class="form-group">
<label for="subtitle">
{{__('Subtitle')}}
</label>
<input name="subtitle" type="text"
class="form-control @error('subtitle') is-invalid @enderror" id="subtitle"
placeholder="{{__('Subtitle')}}" value="{{old('subtitle',$item->subtitle??null)}}"/>
</div>
</div>
<div class="col-md-4 mt-3">
<label for="parent">
{{__('Group Parent')}}
</label>
<select name="parent_id" id="parent"
class="form-control @error('parent') is-invalid @enderror">
<option value=""> {{__('No parent')}} </option>
@foreach($cats as $cat )
@if($cat->id != $item->id)
<option value="{{ $cat->id }}"
@if (old('parent',$item->parent_id??null) == $cat->id ) selected @endif >
{{$cat->name}}
</option>
@endif
@endforeach
</select>
</div>
<div class="col-md-4 mt-3">
<div class="form-group">
<label for="image">
{{__('Feature image')}}
</label>
<input accept=".jpg,.png,.svg" name="image" type="file"
class="form-control @error('image') is-invalid @enderror" id="image"
placeholder="{{__('Feature image')}}"/>
</div>
</div>
<div class="col-md-4 mt-3">
<div class="form-group">
<label for="bg">
{{__('Background image')}}
</label>
<input accept=".jpg,.png,.svg" name="bg" type="file"
class="form-control @error('bg') is-invalid @enderror" id="bg"
placeholder="{{__('Background image')}}"/>
</div>
</div>
<div class="col-md-12 mt-3">
<label for="description">
{{__('Description')}}
</label>
<textarea rows="5" name="description"
class="form-control @error('description') is-invalid @enderror"
placeholder="{{__('Description')}}">{{old('description',$item->description??null)}}</textarea>
</div>
<div class="col-md-12">
<label> &nbsp;</label>
<input name="" type="submit" class="btn btn-primary mt-2" value="{{__('Save')}}"/>
</div>
</div>
</div>
</div>
</div>
@endsection

@ -0,0 +1,15 @@
@extends('admin.templates.panel-list-template')
@section('list-title')
<i class="ri-user-3-line"></i>
{{__("Groups list")}}
@endsection
@section('title')
{{__("Groups list")}} -
@endsection
@section('filter')
{{-- Other filters --}}
@endsection
@section('bulk')
{{-- <option value="-"> - </option> --}}
@endsection

@ -6,6 +6,7 @@
{{-- list side bar start--}}
<div class="col-xl-3">
@include('components.err')
<div class="item-list mb-3">
<div class="row">
<div class="col-8">
@ -95,7 +96,7 @@
</div>
@endif
@include('components.err')
</div>
{{-- list side bar end--}}
@ -132,6 +133,13 @@
</tr>
</thead>
<tbody>
@if(count($items) == 0)
<tr>
<td colspan="100%">
{{__("There is nothing to show!")}}
</td>
</tr>
@else
@foreach($items as $item)
<tr>
<td>
@ -152,7 +160,13 @@
</td>
@else
<td>
@switch($col)
@case($col == 'parent_id')
{{ $item->parent?->{$cols[0]}??'-' }}
@break
@default
{{$item->$col}}
@endswitch
</td>
@endif
@endforeach
@ -171,14 +185,15 @@
@else
<div class="dropdown d-xl-none d-xxl-none">
<a class="btn btn-outline-secondary dropdown-toggle" href="#" role="button"
<a class="btn btn-outline-secondary dropdown-toggle" href="#"
role="button"
data-bs-toggle="dropdown" aria-expanded="false">
</a>
<ul class="dropdown-menu">
@foreach($buttons as $btn => $btnData)
<li>
<a class="dropdown-item {{$btnData['class']}}"
href="{{getRoute($btn,$item->id)}}">
href="{{getRoute($btn,$item->{$item->getRouteKeyName()})}}">
<i class="{{$btnData['icon']}}"></i>
&nbsp;
{{__($btnData['title'])}}
@ -205,8 +220,8 @@
@endif
@else
@if( hasRoute('restore') && $item->trashed())
<a href="{{getRoute('restore',$item->{$item->getRouteKeyName()})}}"
class="btn btn-success btn-sm mx-1"
<a class="btn btn-success btn-sm mx-1"
href="{{getRoute('restore',$item->id)}}" {{--dont change this id to getRouteKeyName --}}
data-bs-toggle="tooltip"
data-bs-placement="top"
data-bs-custom-class="custom-tooltip"
@ -228,7 +243,10 @@
</div>
</td>
</tr>
@endforeach
@endif
</tbody>

@ -11,6 +11,8 @@
<div class="row">
<div class="col-lg-3">
<div class="item-list mb-3">
@include('components.err')
<h3 class="p-3">
<i class="ri-message-3-line"></i>
{{__("Tips")}}
@ -25,7 +27,6 @@
</ul>
</div>
@include('components.err')
</div>
<div class="col-lg-9 ps-xl-1 ps-xxl-1">
<div class="general-form ">

@ -79,7 +79,7 @@
</a>
</li>
<li>
<a>
<a href="{{route('admin.group.index')}}">
<i class="ri-book-3-fill"></i>
{{__('Groups')}}
</a>

@ -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');
});
});
});

Loading…
Cancel
Save