diff --git a/app/Http/Controllers/Bo/CommitmentController.php b/app/Http/Controllers/Bo/CommitmentController.php new file mode 100644 index 0000000..93fa78a --- /dev/null +++ b/app/Http/Controllers/Bo/CommitmentController.php @@ -0,0 +1,167 @@ +authorizeResource(Commitment::class); + } + + /** + * Display a listing of the resource. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Contracts\View\View + */ + public function index(Request $request): \Illuminate\Contracts\View\View + { + /** @var \Illuminate\Database\Eloquent\Builder $commitmentModels */ + $commitmentModels = Commitment::query(); + + /** @var string $search Search field */ + $search = $request->search; + if ($search) { + $this->searchQuery( + $commitmentModels, + $search, + null, + 'title', + ); + } + $searchFields = \implode(', ', [ + Str::ucfirst(trans('validation.attributes.title')) + ]); + + /** Sort columns with a query */ + $this->sortQuery($commitmentModels); + + /** Custom pagination */ + $commitmentModels = $this->paginate($commitmentModels); + + return view('bo.pages.commitments.index', compact('commitmentModels', 'search', 'searchFields')); + } + + + /** + * Show the form for creating a new resource. + * + * @param \App\Models\Commitment $commitment + * @return \Illuminate\Contracts\View\View + */ + public function create(Commitment $commitment): \Illuminate\Contracts\View\View + { + return view('bo.pages.commitments.create', ['commitmentModel' => $commitment]); + } + + /** + * Store a newly created resource in storage. + * + * @param \App\Http\Requests\Bo\Commitments\StoreCommitmentRequest $request + * @return \Illuminate\Http\RedirectResponse + */ + public function store(StoreCommitmentRequest $request): \Illuminate\Http\RedirectResponse + { + return DB::transaction(function () use ($request) { + $commitment = new Commitment(); + $commitment->fill($request->validated()); + + if ($commitment->saveOrFail()) { + return redirect()->route('bo.commitments.edit', $commitment) + ->with('success', __('crud.messages.has_been_created', [ + 'model' => Str::ucfirst(__('models.classes.commitment')) + ])); + } + return redirect()->back() + ->with('error', __('crud.messages.cannot_be_created', [ + 'model' => Str::ucfirst(__('models.classes.commitment')) + ])); + }); + } + + /** + * Show the form for editing the specified resource. + * + * @param App\Models\Commitment $commitment + * @return \Illuminate\Contracts\View\View + */ + public function edit(Commitment $commitment): \Illuminate\Contracts\View\View + { + return view('bo.pages.commitments.edit', ['commitmentModel' => $commitment]); + } + + /** + * Update the specified resource in storage. + * + * @param \App\Http\Requests\Bo\Commitments\UpdateCommitmentRequest $request + * @param \App\Models\Commitment $commitment + * @return \Illuminate\Http\RedirectResponse + */ + public function update(UpdateCommitmentRequest $request, Commitment $commitment): \Illuminate\Http\RedirectResponse + { + return DB::transaction(function () use ($request, $commitment) { + $commitment->fill($request->validated()); + + if ($commitment->saveOrFail()) { + return redirect()->route('bo.commitments.edit', $commitment) + ->with('success', __('crud.messages.has_been_updated', [ + 'model' => Str::ucfirst(__('models.classes.commitment')) + ])); + } + return redirect()->route('bo.commitments.edit', $commitment) + ->with('error', __('crud.messages.cannot_be_updated', [ + 'model' => Str::ucfirst(__('models.classes.commitment')) + ])); + }); + } + + /** + * Remove the specified resource from storage. + * + * @param \App\Models\Commitment $commitment + * @return \Illuminate\Http\RedirectResponse + */ + public function destroy(Commitment $commitment): \Illuminate\Http\RedirectResponse + { + $commitment->products()->detach(); + + if ($commitment->explorerpage()->count() > 3) { + if ($commitment->deleteOrFail()) { + return redirect()->route('bo.commitments.index') + ->with('success', __('crud.messages.has_been_deleted', [ + 'model' => Str::ucfirst(__('models.classes.commitment')) + ])); + } + } + return redirect()->back() + ->with('error', __('crud.messages.cannot_be_deleted', [ + 'model' => Str::ucfirst(__('models.classes.commitment')) + ])); + } + + /** + * Duplicate the specified resource. + * + * @param \App\Models\Commitment $commitment + * @return \Illuminate\Contracts\View\View + */ + public function duplicate(Commitment $commitment): \Illuminate\Contracts\View\View + { + return $this->create($commitment->replicate()); + } +} diff --git a/app/Http/Requests/Bo/Commitments/StoreCommitmentRequest.php b/app/Http/Requests/Bo/Commitments/StoreCommitmentRequest.php new file mode 100644 index 0000000..83265fe --- /dev/null +++ b/app/Http/Requests/Bo/Commitments/StoreCommitmentRequest.php @@ -0,0 +1,53 @@ +check(); + } + + /** + * Prepare the data for validation. + * + * @return void + */ + protected function prepareForValidation() + { + $this->merge([ + 'published' => $this->published ? true : false + ]); + $this->mergePicture('picture'); + } + + /** + * Get the validation rules that apply to the request. + * + * @return array + */ + public function rules() + { + $rules = [ + 'title' => 'required|string|min:3|max:255', + 'picture_alt' => 'required|string|min:3|max:255', + 'picture_title' => 'required|string|min:3|max:255', + 'published' => 'required|boolean', + ]; + return \array_merge( + $rules, + $this->pictureRules('picture', 185, 185, 185, 185, false), + ); + } +} diff --git a/app/Http/Requests/Bo/Commitments/UpdateCommitmentRequest.php b/app/Http/Requests/Bo/Commitments/UpdateCommitmentRequest.php new file mode 100644 index 0000000..c72f17c --- /dev/null +++ b/app/Http/Requests/Bo/Commitments/UpdateCommitmentRequest.php @@ -0,0 +1,18 @@ +create([ - 'picture' => FileStorageHelper::storeFile(new Commitment(), new \SplFileInfo(\resource_path( + Commitment::factory(12)->make()->each(function (Commitment $commitment) { + $commitment->picture = FileStorageHelper::storeFile($commitment, new \SplFileInfo(\resource_path( '../database/factories/assets/commitments/default-picture-185x185.png' - ))) - ]); + ))); + $commitment->saveOrFail(); + }); } } diff --git a/resources/lang/en/crud.php b/resources/lang/en/crud.php index af6b5f2..34bb441 100644 --- a/resources/lang/en/crud.php +++ b/resources/lang/en/crud.php @@ -83,5 +83,12 @@ return [ 'sort_delete' => 'Delete sorting', 'sort_arrow' => 'Here, the arrows are used to sort, not filter.', 'right' => 'You don\'t have the rights', - ] + ], + + 'placeholders' => [ + 'beautiful' => 'A beautiful :field', + 'crossbreeding' => 'M99 X JA57', + 'growth_potential' => '2.18 kg at 49 days', + ], + ]; diff --git a/resources/lang/en/models.php b/resources/lang/en/models.php index 24e9e32..141dedf 100644 --- a/resources/lang/en/models.php +++ b/resources/lang/en/models.php @@ -9,5 +9,6 @@ return [ 'seasonal_section' => 'seasonal section|seasonal sections', 'news' => 'news', 'stamp' => 'stamp', + 'commitment' => 'commitment', ] ]; diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php index 224d443..b91de8b 100644 --- a/resources/lang/en/validation.php +++ b/resources/lang/en/validation.php @@ -241,5 +241,8 @@ return [ 'publish_at' => 'publication date', 'unpublish_at' => 'end of publication date', 'background' => 'background', + 'category' => 'category', + 'publish_at' => 'publication date', + 'unpublish_at' => 'end of publication date', ], ]; diff --git a/resources/lang/fr/crud.php b/resources/lang/fr/crud.php index bda4271..8efb22f 100644 --- a/resources/lang/fr/crud.php +++ b/resources/lang/fr/crud.php @@ -91,5 +91,9 @@ return [ 'sort_delete' => 'Supprimer le tri', 'sort_arrow' => 'Ici, les flèches sont utilisées pour trier et non pour filtrer', 'right' => 'Vous n\'avez pas les droits', + ], + + 'placeholders' => [ + 'beautiful' => 'Un beau :field', ] ]; diff --git a/resources/lang/fr/models.php b/resources/lang/fr/models.php index 5c455e4..29cabe6 100644 --- a/resources/lang/fr/models.php +++ b/resources/lang/fr/models.php @@ -5,6 +5,7 @@ return [ 'user' => 'utilisateur', 'activity_log' => 'journal d\'activité|journaux d\'activité', 'static_page' => 'page statique|pages statiques', + 'commitment' => 'engagement', 'range' => 'gamme', 'seasonal_section' => 'section saisonnière|sections saisonnières', 'news' => 'actualité', diff --git a/resources/lang/fr/validation.php b/resources/lang/fr/validation.php index fd38662..fd090d5 100644 --- a/resources/lang/fr/validation.php +++ b/resources/lang/fr/validation.php @@ -12,7 +12,8 @@ return [ 'alpha_dash' => 'Le champ :attribute doit contenir uniquement des lettres, des chiffres et des tirets.', 'alpha_num' => 'Le champ :attribute doit contenir uniquement des chiffres et des lettres.', 'array' => 'Le champ :attribute doit être un tableau.', - 'ascii' => 'Le champ :attribute ne doit contenir que des caractères alphanumériques et des symboles codés sur un octet.', + 'ascii' => 'Le champ :attribute ne doit contenir que des caractères alphanumériques + et des symboles codés sur un octet.', 'before' => 'Le champ :attribute doit être une date antérieure au :date.', 'before_or_equal' => 'Le champ :attribute doit être une date antérieure ou égale au :date.', 'between' => [ @@ -108,7 +109,8 @@ return [ 'mixed' => 'Le champ :attribute doit contenir au moins une majuscule et une minuscule.', 'numbers' => 'Le champ :attribute doit contenir au moins un chiffre.', 'symbols' => 'Le champ :attribute doit contenir au moins un symbole.', - 'uncompromised' => 'La valeur du champ :attribute est apparue dans une fuite de données. Veuillez choisir une valeur différente.', + 'uncompromised' => 'La valeur du champ :attribute est apparue dans une fuite de données. + Veuillez choisir une valeur différente.', ], 'present' => 'Le champ :attribute doit être présent.', 'prohibited' => 'Le champ :attribute est interdit.', @@ -241,5 +243,8 @@ return [ 'publish_at' => 'date de publication', 'unpublish_at' => 'date de fin de publication', 'background' => 'fond', + 'category' => 'catégorie', + 'publish_at' => 'date de publication', + 'unpublish_at' => 'date de fin de publication', ], ]; diff --git a/resources/views/bo/layouts/nav-list.blade.php b/resources/views/bo/layouts/nav-list.blade.php index 8623394..54d66d8 100644 --- a/resources/views/bo/layouts/nav-list.blade.php +++ b/resources/views/bo/layouts/nav-list.blade.php @@ -15,10 +15,18 @@ @endcan + @can('viewAny', \App\Models\Commitment::class) + + @endcan @can('viewAny', \App\Models\Range::class)
  • - {{ Str::of(__('models.classes.range'))->plural()->ucfirst() }} @@ -51,6 +59,15 @@
  • @endcan + @can('viewAny', \App\Models\News::class) + + @endcan @canAny(['isConceptor', 'viewAny'], \App\Models\User::class) @endcan - + @endcan diff --git a/resources/views/bo/pages/commitments/create.blade.php b/resources/views/bo/pages/commitments/create.blade.php new file mode 100644 index 0000000..8e21b9a --- /dev/null +++ b/resources/views/bo/pages/commitments/create.blade.php @@ -0,0 +1,36 @@ +@extends('bo.layout', ['brParam' => $commitmentModel]) + +@section('title', trans_choice('crud.meta.title.create', 0, ['model' => __('models.classes.commitment')])) +@section('description', trans_choice('crud.meta.description.create', 2, ['model' => __('models.classes.commitment')])) +@section('breadcrumb', + request()->route()->getName()) + +@section('content') +
    +
    + + + + @include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $commitmentModel]) +
    +
    + +
    +
    +
    + @csrf + @include('bo.pages.commitments.form') +
    +
    + +
    +
    +
    +@endsection diff --git a/resources/views/bo/pages/commitments/edit.blade.php b/resources/views/bo/pages/commitments/edit.blade.php new file mode 100644 index 0000000..f6a432a --- /dev/null +++ b/resources/views/bo/pages/commitments/edit.blade.php @@ -0,0 +1,53 @@ +@extends('bo.layout', ['brParam' => $commitmentModel]) + +@section('title', trans_choice('crud.meta.title.edit', 0, ['model' => __('models.classes.commitment')])) +@section('description', trans_choice('crud.meta.description.edit', 0, ['model' => __('models.classes.commitment')])) +@section('breadcrumb', + request()->route()->getName()) + +@section('content') +
    +
    + + + + @include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $commitmentModel]) +
    +
    +
    + @can('duplicate', $commitmentModel) + + + + @endcan + + @can('delete', $commitmentModel) + @csrf + @method('DELETE') + + @endcan +
    +
    +
    +
    + @csrf + @method('PUT') + @include('bo.pages.commitments.form') +
    +
    + +
    +
    +
    +@endsection diff --git a/resources/views/bo/pages/commitments/form.blade.php b/resources/views/bo/pages/commitments/form.blade.php new file mode 100644 index 0000000..317362b --- /dev/null +++ b/resources/views/bo/pages/commitments/form.blade.php @@ -0,0 +1,146 @@ +
    + {{-- TITLE --}} +
    +
    + {{ Str::ucfirst(__('validation.attributes.title')) }} +
    +
    + @include('bo.partials.inputs.varchar', [ + 'id' => 'commitmentTitle', + 'label' => __(':field :inter:model', [ + 'field' => Str::ucfirst(__('validation.attributes.title')), + 'inter' => __('validation.custom.of_the.vowel'), + 'model' => __('models.classes.commitment'), + ]), + 'hasWordCounter' => true, + 'name' => 'title', + 'required' => true, + 'model' => $commitmentModel ?? null, + 'helper' => __('validation.between.string', [ + 'attribute' => __(':field :inter:model', [ + 'field' => __('validation.attributes.title'), + 'inter' => __('validation.custom.of_the.vowel'), + 'model' => __('models.classes.commitment'), + ]), + 'min' => 3, + 'max' => 255, + ]), + 'placeholder' => __('crud.placeholders.beautiful', ['field' => __('validation.attributes.title')]), + ]) +
    +
    +
    +
    + {{-- STATUS --}} +
    +
    + {{ __('crud.minicrud.visibility_label') }} +
    +
    + @include('bo.partials.inputs.tinyint-boolean', [ + 'id' => 'commitmentStatus', + 'name' => 'published', + 'model' => $commitmentModel ?? null, + 'label' => __('crud.minicrud.visibility_label'), + 'helper' => sprintf('%s', __('crud.minicrud.visibility_helper')), + ]) +
    +
    +
    +
    + + {{-- PICTURE --}} +
    +
    + {{ Str::ucfirst(__('validation.custom.picture')) }} +
    + {{-- PICTURE_ALT --}} +
    + @include('bo.partials.inputs.varchar', [ + 'id' => 'commitmentPictureAlt', + 'label' => __(':field1 :inter1:field2 :inter2:model', [ + 'field1' => Str::ucfirst(__('validation.custom.attribute_alt')), + 'inter1' => __('validation.custom.of_the.vowel'), + 'field2' => __('validation.custom.picture'), + 'inter2' => __('validation.custom.of_the.vowel'), + 'model' => __('models.classes.commitment'), + ]), + 'hasWordCounter' => true, + 'name' => 'picture_alt', + 'required' => true, + 'model' => $commitmentModel ?? null, + 'helper' => __('crud.minicrud.picture_alt_helper'), + 'placeholder' => __(':field1 :inter1:field2 :inter2:model', [ + 'field1' => Str::ucfirst(__('validation.custom.attribute_alt')), + 'inter1' => __('validation.custom.of_the.vowel'), + 'field2' => __('validation.custom.picture'), + 'inter2' => __('validation.custom.of_the.vowel'), + 'model' => __('models.classes.commitment'), + ]), + ]) +
    + {{-- PICTURE_TITLE --}} +
    + @include('bo.partials.inputs.varchar', [ + 'id' => 'commitmentPictureTitle', + 'label' => __(':field1 :inter1:field2 :inter2:model', [ + 'field1' => Str::ucfirst(__('validation.custom.attribute_title')), + 'inter1' => __('validation.custom.of_the.vowel'), + 'field2' => __('validation.custom.picture'), + 'inter2' => __('validation.custom.of_the.vowel'), + 'model' => __('models.classes.commitment'), + ]), + 'hasWordCounter' => true, + 'name' => 'picture_title', + 'required' => true, + 'model' => $commitmentModel ?? null, + 'helper' => __('crud.minicrud.picture_title_helper'), + 'placeholder' => __(':field1 :inter1:field2 :inter2:model', [ + 'field1' => Str::ucfirst(__('validation.custom.attribute_title')), + 'inter1' => __('validation.custom.of_the.vowel'), + 'field2' => __('validation.custom.picture'), + 'inter2' => __('validation.custom.of_the.vowel'), + 'model' => __('models.classes.commitment'), + ]), + ]) +
    + {{-- PICTURE --}} +
    + @include('bo.partials.inputs.varchar-picture', [ + 'id' => 'commitmentPicture', + 'name' => 'picture', + 'width' => 185, + 'height' => 185, + 'model' => $commitmentModel ?? null, + 'helper' => __('crud.minicrud.dimensions_must_be', [ + 'widthpx' => '185px', + 'heightpx' => '185px', + ]), + 'required' => true, + 'preview' => true, + ]) +
    +
    +
    +
    + +
    +
    +

    * {{ __('crud.helpers.required_fields') }}

    +
    +
    +
    + +@push('scripts') + +@endpush diff --git a/resources/views/bo/pages/commitments/index-list.blade.php b/resources/views/bo/pages/commitments/index-list.blade.php new file mode 100644 index 0000000..7237208 --- /dev/null +++ b/resources/views/bo/pages/commitments/index-list.blade.php @@ -0,0 +1,77 @@ + + @if (count($commitmentModels) > 0) + + @include('bo.modules.table-col-sorter', [ + 'cols' => [ + 'title' => Str::ucfirst(__('validation.attributes.title')), + 'picture' => Str::ucfirst(__('validation.custom.picture')), + 'updated_at' => Str::ucfirst(__('validation.attributes.updated_at')), + 'order' => Str::ucfirst(__('validation.custom.order')), + ], + ]) + + + @foreach ($commitmentModels as $commitmentModel) + + + + + @php + $routeName = request() + ->route() + ->getName(); + @endphp + @if (empty(request()->search) && Session::get("$routeName.sort_col") === 'order') + @include('bo.modules.change-model-order', [ + 'routeName' => 'commitments', + 'model' => $commitmentModel, + 'models' => $commitmentModels, + ]) + @endif + + + @endforeach + + @else + + + + @endif +
    {{ $commitmentModel->title }} + {{ $commitmentModel->picture_alt }} + + {{ $commitmentModel->updated_at->isoFormat('LLLL') }} + + @canAny(['delete', 'duplicate', 'update'], $commitmentModel) +
    + @can('duplicate', $commitmentModel) + + + + @endcan + @can('update', $commitmentModel) + + + + @endcan + @can('delete', $commitmentModel) + @csrf + @method('DELETE') + + @endcan +
    + @else + + + + @endcan +
    {{ __('crud.other.no_model_found', ['model' => __('models.classes.commitment')]) }}
    diff --git a/resources/views/bo/pages/commitments/index.blade.php b/resources/views/bo/pages/commitments/index.blade.php new file mode 100644 index 0000000..b56ea07 --- /dev/null +++ b/resources/views/bo/pages/commitments/index.blade.php @@ -0,0 +1,22 @@ +@extends('bo.layout') + +@section('title', + Str::of(__('models.classes.commitment'))->plural()->ucfirst()) +@section('description', trans_choice('crud.meta.description.index', 0, ['model' => Str::plural(__('models.classes.commitment'))])) + +@section('content') +
    + @include('modules.breadcrumbs.breadcrumb-body') + @can('create', \App\Models\Commitment::class) + + + + @endcan +
    + @include('bo.modules.search-bar') +
    + @include('bo.pages.commitments.index-list') +
    + {{ $commitmentModels->links() }} +@endsection diff --git a/routes/breadcrumbs-bo.php b/routes/breadcrumbs-bo.php index 838896f..a2cce12 100644 --- a/routes/breadcrumbs-bo.php +++ b/routes/breadcrumbs-bo.php @@ -1,10 +1,12 @@ push(Str::ucfirst(trans('crud.actions.duplicate'))); }); +// * COMMITMENTS +Breadcrumbs::for('bo.commitments.index', function (Generator $trail) { + $trail->push( + Str::of(trans('models.classes.commitment'))->plural()->ucfirst(), + route('bo.commitments.index', ['sort_col' => 'updated_at', 'sort_way' => 'desc']) + ); +}); +Breadcrumbs::for('bo.commitments.create', function (Generator $trail) { + $trail->parent('bo.commitments.index'); + $trail->push(Str::ucfirst(trans('crud.actions.create')), route('bo.commitments.create')); +}); +Breadcrumbs::for('bo.commitments.edit', function (Generator $trail, Commitment $commitment) { + $trail->parent('bo.commitments.index'); + $trail->push(Str::ucfirst(trans('crud.actions.edit')), route('bo.commitments.edit', $commitment)); +}); +Breadcrumbs::for('bo.commitments.duplicate', function (Generator $trail) { + $trail->parent('bo.commitments.index'); + $trail->push(Str::ucfirst(trans('crud.actions.duplicate'))); +}); + // * ACTIVITY_LOGS Breadcrumbs::for('bo.activity_logs.index', function (Generator $trail) { $trail->push( @@ -134,3 +156,23 @@ Breadcrumbs::for('bo.stamps.duplicate', function (Generator $trail) { $trail->parent('bo.stamps.index'); $trail->push(Str::ucfirst(trans('crud.actions.duplicate'))); }); + +// * NEWS +Breadcrumbs::for('bo.news.index', function (Generator $trail) { + $trail->push( + Str::of(trans('models.classes.news'))->plural()->ucfirst(), + route('bo.news.index', ['sort_col' => 'updated_at', 'sort_way' => 'desc']) + ); +}); +Breadcrumbs::for('bo.news.create', function (Generator $trail) { + $trail->parent('bo.news.index'); + $trail->push(Str::ucfirst(trans('crud.actions.create')), route('bo.news.create')); +}); +Breadcrumbs::for('bo.news.edit', function (Generator $trail, News $news) { + $trail->parent('bo.news.index'); + $trail->push(Str::ucfirst(trans('crud.actions.edit')), route('bo.news.edit', $news)); +}); +Breadcrumbs::for('bo.news.duplicate', function (Generator $trail) { + $trail->parent('bo.news.index'); + $trail->push(Str::ucfirst(trans('crud.actions.duplicate'))); +}); diff --git a/routes/web-bo.php b/routes/web-bo.php index cd4866f..8dea6a0 100644 --- a/routes/web-bo.php +++ b/routes/web-bo.php @@ -1,6 +1,7 @@ name('users.duplicate'); + // * COMMITMENTS + Route::resource('commitments', CommitmentController::class)->except(['show']) + ->withoutMiddleware('htmlsanitize') + ->middleware('htmlsanitize:content'); + Route::get('/commitments/{commitment}/duplicate', [ + CommitmentController::class, 'duplicate' + ])->name('commitments.duplicate'); + // Change order. + Route::patch('/commitments/{commitment}/change-order/{direction}', [ + CommitmentController::class, 'changeOrder' + ])->where('direction', 'up|down')->name('commitments.change-order'); + // * STATIC_PAGES Route::resource('pages', StaticPageController::class) ->names([ @@ -107,6 +120,20 @@ Route::prefix('bo') StampController::class, 'duplicate' ])->name('stamps.duplicate'); + // * NEWS. + Route::resource('news', NewsController::class)->except('show') + ->withoutMiddleware('htmlsanitize') + ->middleware('htmlsanitize:content'); + Route::patch('/news/{news}/change-published', [ + NewsController::class, 'changePublished' + ])->name('news.change-published'); + Route::patch('/news/{news}/change-order/{direction}', [ + RangeController::class, 'changeOrder' + ])->where('direction', 'up|down')->name('news.change-order'); + Route::get('/news/{news}/duplicate', [ + NewsController::class, 'duplicate' + ])->name('news.duplicate'); + Route::middleware('can:isConceptor')->group(function () { // * ACTIVITY LOGS. Route::resource('activity_logs', ActivityLogsController::class)->only(['index', 'show']);