diff --git a/app/Http/Controllers/Bo/HomepageController.php b/app/Http/Controllers/Bo/HomepageController.php new file mode 100644 index 0000000..31964aa --- /dev/null +++ b/app/Http/Controllers/Bo/HomepageController.php @@ -0,0 +1,93 @@ +authorizeResource(Homepage::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 $homepageModels */ + $homepageModels = Homepage::query(); + + /** @var string $search Search field */ + $search = $request->search; + if ($search) { + $this->searchQuery( + $homepageModels, + $search, + null, + 'title_part1', + 'title_part2', + 'title_part3' + ); + } + $searchFields = \implode(', ', [ + Str::ucfirst(trans('validation.attributes.title')) + ]); + + /** Sort columns with a query */ + $this->sortQuery($homepageModels); + + /** Custom pagination */ + $homepageModels = $this->paginate($homepageModels); + + return view('bo.pages.homepages.index', compact('homepageModels', 'search', 'searchFields')); + } + + /** + * Show the form for editing the specified resource. + * + * @param App\Models\Homepage $homepage + * @return \Illuminate\Contracts\View\View + */ + public function edit(Homepage $homepage): \Illuminate\Contracts\View\View + { + return view('bo.pages.homepages.edit', ['homepageModel' => $homepage]); + } + + /** + * Update the specified resource in storage. + * + * @param \App\Http\Requests\Bo\Homepages\UpdateHomepageRequest $request + * @param \App\Models\Homepage $homepage + * @return \Illuminate\Http\RedirectResponse + */ + public function update(UpdateHomepageRequest $request, Homepage $homepage): \Illuminate\Http\RedirectResponse + { + return DB::transaction(function () use ($request, $homepage) { + $homepage->fill($request->validated()); + + if ($homepage->saveOrFail()) { + return redirect()->route('bo.homepages.edit', $homepage) + ->with('success', __('crud.messages.has_been_updated', [ + 'model' => Str::ucfirst(__('models.classes.homepage')) + ])); + } + return redirect()->route('bo.homepages.edit', $homepage) + ->with('error', __('crud.messages.cannot_be_updated', [ + 'model' => Str::ucfirst(__('models.classes.homepage')) + ])); + }); + } +} diff --git a/app/Http/Requests/Bo/Homepage/StoreHomepageRequest.php b/app/Http/Requests/Bo/Homepage/StoreHomepageRequest.php new file mode 100644 index 0000000..f6b0d87 --- /dev/null +++ b/app/Http/Requests/Bo/Homepage/StoreHomepageRequest.php @@ -0,0 +1,53 @@ +check(); + } + + /** + * Prepare the data for validation. + * + * @return void + */ + protected function prepareForValidation() + { + $this->mergePicture('picture'); + } + + /** + * Get the validation rules that apply to the request. + * + * @return array + */ + public function rules() + { + $rules = [ + 'title_part1' => 'required|string|between:3,255', + 'title_part2' => 'required|string|between:3,255', + 'title_part3' => 'required|string|between:3,255', + 'picture_alt' => 'required|string|between:3,255', + 'picture_title' => 'required|string|between:3,255', + 'presentation_title' => 'required|string|between:3,255', + 'presentation_content' => 'required|string', + ]; + return \array_merge( + $rules, + $this->pictureRules('picture', 640, 390, 640, 390, false), + ); + } +} diff --git a/app/Http/Requests/Bo/Homepage/UpdateHomepageRequest.php b/app/Http/Requests/Bo/Homepage/UpdateHomepageRequest.php new file mode 100644 index 0000000..a102925 --- /dev/null +++ b/app/Http/Requests/Bo/Homepage/UpdateHomepageRequest.php @@ -0,0 +1,18 @@ + */ protected $fillable = [ - 'title_part_1', - 'title_part_2', - 'title_part_3', + 'title_part1', + 'title_part2', + 'title_part3', 'picture', 'picture_alt', 'picture_title', diff --git a/app/Policies/HomepagePolicy.php b/app/Policies/HomepagePolicy.php new file mode 100644 index 0000000..27ab78c --- /dev/null +++ b/app/Policies/HomepagePolicy.php @@ -0,0 +1,43 @@ + 'Must give a precise description of the page, which is recommended for optimum positioning in search engines ( tag).', 'seo_description' => 'Must give a precise description of the page content (<meta> description tag).', + 'required_fields' => 'Required fields', ], 'libs' => [ diff --git a/resources/lang/en/models.php b/resources/lang/en/models.php index 707a36d..8bd891d 100644 --- a/resources/lang/en/models.php +++ b/resources/lang/en/models.php @@ -6,6 +6,7 @@ return [ 'activity_log' => 'activity log|activity logs', 'static_page' => 'static page|static pages', 'commitment' => 'commitment', - 'range' => 'range' + 'range' => 'range', + 'homepage' => 'homepage' ] ]; diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php index 0a1e271..7b6d7f4 100644 --- a/resources/lang/en/validation.php +++ b/resources/lang/en/validation.php @@ -238,6 +238,11 @@ return [ 'picture_productsheet' => 'productsheet picture', 'picture_thumbnail' => 'thumbnail', 'background' => 'background', + 'picture' => 'picture', + 'presentation_title' => 'presentation title', + 'title_part1' => 'title part one', + 'title_part2' => 'title part two', + 'title_part3' => 'title part three', ], ]; diff --git a/resources/lang/fr/crud.php b/resources/lang/fr/crud.php index ede6326..f79a9ed 100644 --- a/resources/lang/fr/crud.php +++ b/resources/lang/fr/crud.php @@ -28,6 +28,7 @@ return [ 'seo_title' => 'Doit décrire précisément la page, recommandation pour un positionnement optimal dans les moteurs de recherche (balise <title>).', 'seo_description' => 'Doit décrire précisément le contenu de la page (balise <meta> description).', + 'required_fields' => 'Champs obligatoires', ], diff --git a/resources/lang/fr/models.php b/resources/lang/fr/models.php index 0aa86a7..4f4f414 100644 --- a/resources/lang/fr/models.php +++ b/resources/lang/fr/models.php @@ -8,5 +8,6 @@ return [ 'commitment' => 'engagement', 'range' => 'gamme', 'seasonal_section' => 'section saisonnière|sections saisonnières', + 'homepage' => 'page d\'accueil' ] ]; diff --git a/resources/lang/fr/validation.php b/resources/lang/fr/validation.php index 3a0d7a6..46ca6d7 100644 --- a/resources/lang/fr/validation.php +++ b/resources/lang/fr/validation.php @@ -240,5 +240,10 @@ return [ 'picture_productsheet' => 'image de la fiche produit', 'picture_thumbnail' => 'vignette', 'background' => 'fond', + 'picture' => 'image', + 'presentation_title' => 'titre de présentation', + 'title_part1' => 'première partie du titre', + 'title_part2' => 'seconde partie du titre', + 'title_part3' => 'dernière partie du titre', ], ]; diff --git a/resources/views/bo/layouts/nav-list.blade.php b/resources/views/bo/layouts/nav-list.blade.php index c805b5c..c12b633 100644 --- a/resources/views/bo/layouts/nav-list.blade.php +++ b/resources/views/bo/layouts/nav-list.blade.php @@ -41,6 +41,15 @@ </a> </li> @endcan + @can('viewAny', \App\Models\Homepage::class) + <li> + <a class="nav-link @if (request()->routeIs('bo.homepages.*')) active @endif" data-bs-toggle="tooltip" + href="{{ route('bo.homepages.index') }}" + title="{{ __('crud.helpers.list_all', ['model' => Str::of(__('models.classes.commitment'))->plural()]) }}"> + {{ Str::of(__('models.classes.homepage'))->plural()->ucfirst() }} + </a> + </li> + @endcan @canAny(['isConceptor', 'viewAny'], \App\Models\User::class) <li class="nav-item"> <div class="dropdown"> diff --git a/resources/views/bo/pages/homepages/edit.blade.php b/resources/views/bo/pages/homepages/edit.blade.php new file mode 100644 index 0000000..f7bc9a0 --- /dev/null +++ b/resources/views/bo/pages/homepages/edit.blade.php @@ -0,0 +1,39 @@ +@extends('bo.layout', ['brParam' => $homepageModel]) + +@section('title', trans_choice('crud.meta.title.edit', 0, ['model' => __('models.classes.homepage')])) +@section('description', trans_choice('crud.meta.description.edit', 0, ['model' => __('models.classes.homepage')])) +@section('breadcrumb', + request()->route()->getName()) + +@section('content') + <div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3"> + <div class="d-flex align-items-start flex-row"> + <a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.homepages.index') }}" + title="{{ __('crud.helpers.list_all', ['model' => Str::plural(__('models.classes.homepage'))]) }}"> + <i class="fa-solid fa-arrow-left"></i> + </a> + @include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $homepageModel]) + </div> + <div class="mb-md-0 mb-2"> + <form class="btn-group confirmDeleteTS" action="{{ route('bo.homepages.edit', $homepageModel) }}" method="POST" novalidate> + <button class="btn btn-primary" id="formSubmitClone" data-bs-toggle="tooltip" type="submit" + title="{{ __('crud.helpers.save_model', ['model' => __('models.classes.homepage')]) }}"> + {{ Str::ucfirst(__('crud.actions.save')) }} + </button> + </form> + </div> + </div> + <form action="{{ route('bo.homepages.update', $homepageModel) }}" method="POST" enctype="multipart/form-data"> + @csrf + @method('PUT') + @include('bo.pages.homepages.form') + <div class="row"> + <div class="col text-center"> + <button class="btn btn-primary" id="formSubmit" data-bs-toggle="tooltip" type="submit" + title="{{ __('crud.helpers.save_model', ['model' => __('models.classes.homepage')]) }}"> + {{ Str::ucfirst(__('crud.actions.save')) }} + </button> + </div> + </div> + </form> +@endsection diff --git a/resources/views/bo/pages/homepages/form.blade.php b/resources/views/bo/pages/homepages/form.blade.php new file mode 100644 index 0000000..54b145b --- /dev/null +++ b/resources/views/bo/pages/homepages/form.blade.php @@ -0,0 +1,245 @@ +<div class="row"> + {{-- TITLE PART 1 --}} + <div class="col-12 col-md-6 mb-3"> + <fieldset class="h-100 border p-3"> + <legend>{{ Str::ucfirst(__('validation.custom.title_part1')) }}</legend> + <div class="row"> + <div class="col-12"> + @include('bo.partials.inputs.varchar', [ + 'id' => 'homepageTitlePart1', + 'label' => __(':field :inter:model', [ + 'field' => Str::ucfirst(__('validation.custom.title_part1')), + 'inter' => __('validation.custom.of_the.female'), + 'model' => __('models.classes.homepage'), + ]), + 'hasWordCounter' => true, + 'name' => 'title_part1', + 'required' => true, + 'model' => $homepageModel ?? null, + 'helper' => __('validation.between.string', [ + 'attribute' => __(':field :inter:model', [ + 'field' => __('validation.custom.title_part1'), + 'inter' => __('validation.custom.of_the.female'), + 'model' => __('models.classes.homepage'), + ]), + 'min' => 3, + 'max' => 255, + ]), + 'placeholder' => __('crud.placeholders.beautiful', ['field' => __('validation.attributes.title')]), + ]) + </div> + </div> + </fieldset> + </div> + {{-- TITLE PART 2 --}} + <div class="col-12 col-md-6 mb-3"> + <fieldset class="h-100 border p-3"> + <legend>{{ Str::ucfirst(__('validation.custom.title_part2')) }}2</legend> + <div class="row"> + <div class="col-12"> + @include('bo.partials.inputs.varchar', [ + 'id' => 'homepageTitlePart2', + 'label' => __(':field :inter:model', [ + 'field' => Str::ucfirst(__('validation.custom.title_part2')), + 'inter' => __('validation.custom.of_the.female'), + 'model' => __('models.classes.homepage'), + ]), + 'hasWordCounter' => true, + 'name' => 'title_part2', + 'required' => true, + 'model' => $homepageModel ?? null, + 'helper' => __('validation.between.string', [ + 'attribute' => __(':field :inter:model', [ + 'field' => __('validation.custom.title_part2'), + 'inter' => __('validation.custom.of_the.female'), + 'model' => __('models.classes.homepage'), + ]), + 'min' => 3, + 'max' => 255, + ]), + 'placeholder' => __('crud.placeholders.beautiful', ['field' => __('validation.attributes.title')]), + ]) + </div> + </div> + </fieldset> + </div> + {{-- TITLE PART 3 --}} + <div class="col-12 col-md-6 mb-3"> + <fieldset class="h-100 border p-3"> + <legend>{{ Str::ucfirst(__('validation.custom.title_part3')) }}3</legend> + <div class="row"> + <div class="col-12"> + @include('bo.partials.inputs.varchar', [ + 'id' => 'homepageTitlePart3', + 'label' => __(':field :inter:model', [ + 'field' => Str::ucfirst(__('validation.custom.title_part3')), + 'inter' => __('validation.custom.of_the.female'), + 'model' => __('models.classes.homepage'), + ]), + 'hasWordCounter' => true, + 'name' => 'title_part3', + 'required' => true, + 'model' => $homepageModel ?? null, + 'helper' => __('validation.between.string', [ + 'attribute' => __(':field :inter:model', [ + 'field' => __('validation.custom.title_part3'), + 'inter' => __('validation.custom.of_the.female'), + 'model' => __('models.classes.homepage'), + ]), + 'min' => 3, + 'max' => 255, + ]), + 'placeholder' => __('crud.placeholders.beautiful', ['field' => __('validation.attributes.title')]), + ]) + </div> + </div> + </fieldset> + </div> + {{-- PICTURE --}} + <div class="col-12 pb-3"> + <fieldset class="h-100 border p-3"> + <legend>{{ Str::ucfirst(__('validation.custom.picture')) }}</legend> + <div class="row mb-3"> + {{-- PICTURE_ALT --}} + <div class="col-12 col-md-6 m-md-0 mb-3"> + @include('bo.partials.inputs.varchar', [ + 'id' => 'homepagePictureAlt', + '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.female'), + 'model' => __('models.classes.homepage'), + ]), + 'hasWordCounter' => true, + 'name' => 'picture_alt', + 'required' => true, + 'model' => $homepageModel ?? 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.female'), + 'model' => __('models.classes.homepage'), + ]), + ]) + </div> + {{-- PICTURE_TITLE --}} + <div class="col-12 col-md-6 mb-3"> + @include('bo.partials.inputs.varchar', [ + 'id' => 'homepagePictureTitle', + '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.female'), + 'model' => __('models.classes.homepage'), + ]), + 'hasWordCounter' => true, + 'name' => 'picture_title', + 'required' => true, + 'model' => $homepageModel ?? 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.female'), + 'model' => __('models.classes.homepage'), + ]), + ]) + </div> + {{-- PICTURE --}} + <div class="col-12"> + @include('bo.partials.inputs.varchar-picture', [ + 'id' => 'homepagePicture', + 'name' => 'picture', + 'width' => 640, + 'height' => 390, + 'model' => $homepageModel ?? null, + 'helper' => __('crud.minicrud.dimensions_must_be', [ + 'widthpx' => '640px', + 'heightpx' => '390px', + ]), + 'required' => true, + 'preview' => true, + ]) + </div> + </div> + </fieldset> + </div> + {{-- PRESENTATION TITLE --}} + <div class="col-12 col-md-6 mb-3"> + <fieldset class="h-100 border p-3"> + <legend>{{ Str::ucfirst(__('validation.custom.presentation_title')) }}</legend> + <div class="row"> + <div class="col-12"> + @include('bo.partials.inputs.varchar', [ + 'id' => 'homepagePresentationTitle', + 'label' => __(':field :inter:model', [ + 'field' => Str::ucfirst(__('validation.custom.presentation_title')), + 'inter' => __('validation.custom.of_the.female'), + 'model' => __('models.classes.homepage'), + ]), + 'hasWordCounter' => true, + 'name' => 'presentation_title', + 'required' => true, + 'model' => $homepageModel ?? null, + 'helper' => __('validation.between.string', [ + 'attribute' => __(':field :inter:model', [ + 'field' => __('validation.custom.presentation_title'), + 'inter' => __('validation.custom.of_the.female'), + 'model' => __('models.classes.homepage'), + ]), + 'min' => 3, + 'max' => 255, + ]), + 'placeholder' => __('crud.placeholders.beautiful', ['field' => __('validation.attributes.title')]), + ]) + </div> + </div> + </fieldset> + </div> + {{-- CONTENT --}} + <div class="col-12 mb-3"> + <fieldset class="border p-3"> + <legend>{{ Str::ucfirst(__('validation.attributes.content')) }}</legend> + <div class="row mb-3"> + <div class="col-12"> + @include('bo.partials.inputs.text-html', [ + 'id' => 'homepagePresentationContent', + 'label' => __(':field :inter:model', [ + 'field' => Str::ucfirst(__('validation.attributes.content')), + 'inter' => __('validation.custom.of_the.female'), + 'model' => __('models.classes.homepage'), + ]), + 'name' => 'presentation_content', + 'model' => $homepageModel ?? null, + 'required' => true, + 'helper' => __('crud.minicrud.text_warning'), + ]) + </div> + </div> + </fieldset> + </div> + <div class="row"> + <div class="col text-center"> + <p><b>* {{ __('crud.helpers.required_fields') }}</b></p> + </div> + </div> +</div> + +@push('scripts') + <script nonce="{{ $nonce }}"> + document.addEventListener("DOMContentLoaded", () => { + // Submit button clone. + const submit = document.getElementById('formSubmit') + submitClone = document.getElementById('formSubmitClone'); + submitClone.addEventListener('click', (event) => { + event.preventDefault(); + submit.click(''); + }) + }); + </script> +@endpush diff --git a/resources/views/bo/pages/homepages/index-list.blade.php b/resources/views/bo/pages/homepages/index-list.blade.php new file mode 100644 index 0000000..41304dd --- /dev/null +++ b/resources/views/bo/pages/homepages/index-list.blade.php @@ -0,0 +1,62 @@ +<table class="table-hover table-fix-action m-0 table"> + @if (count($homepageModels) > 0) + <thead> + @include('bo.modules.table-col-sorter', [ + 'cols' => [ + 'title_part1' => Str::ucfirst(__('validation.custom.title_part1')), + 'title_part2' => Str::ucfirst(__('validation.custom.title_part2')), + 'title_part3' => Str::ucfirst(__('validation.custom.title_part3')), + 'picture' => Str::ucfirst(__('validation.custom.picture')), + 'presentation_title' => Str::ucfirst(__('validation.custom.presentation_title')), + 'presentation_content' => Str::ucfirst(__('validation.attributes.content')), + 'updated_at' => Str::ucfirst(__('validation.attributes.updated_at')), + ], + ]) + </thead> + <tbody> + @foreach ($homepageModels as $homepageModel) + <tr class="border-bottom list-item"> + <td class="text-center align-middle">{{ $homepageModel->title_part1 }}</td> + <td class="text-center align-middle">{{ $homepageModel->title_part2 }}</td> + <td class="text-center align-middle">{{ $homepageModel->title_part3 }}</td> + <td class="text-center align-middle"> + <img src="{{ asset($homepageModel->picture) }}" title="{{ $homepageModel->picture_title }}" + alt="{{ $homepageModel->picture_alt }}" height="50px"> + </td> + <td class="text-center align-middle">{{ $homepageModel->presentation_title }}</td> + <td class="text-center align-middle">{!! Str::limit($homepageModel->presentation_content, 100) !!}</td> + <td class="text-center align-middle"> + <span class="badge bg-secondary">{{ $homepageModel->updated_at->isoFormat('LLLL') }}</span> + </td> + @php + $routeName = request() + ->route() + ->getName(); + @endphp + <td class="text-end align-middle"> + @canAny(['update'], $homepageModel) + <form class="btn-group confirmDeleteTS" action="{{ route('bo.homepages.edit', $homepageModel) }}" method="POST" + novalidate> + @can('update', $homepageModel) + <a class="btn btn-sm btn-primary" data-bs-toggle="tooltip" + href="{{ route('bo.homepages.edit', ['homepage' => $homepageModel]) }}" + title="{{ Str::ucfirst(__('crud.actions.update')) }}"> + <i class="fa-solid fa-pencil"></i> + </a> + @endcan + </form> + @else + <span class="text-danger" data-bs-toggle="tooltip" title="{{ __('list.right') }}"> + <i class="fa-solid fa-ban"></i> + </span> + @endcan + </td> + </tr> + @endforeach + </tbody> + @else + <tr> + <td class="border-0">{{ __('crud.other.no_model_found', ['model' => __('models.classes.homepage')]) }}</td> + </tr> + @endif +</table> diff --git a/resources/views/bo/pages/homepages/index.blade.php b/resources/views/bo/pages/homepages/index.blade.php new file mode 100644 index 0000000..4554bcd --- /dev/null +++ b/resources/views/bo/pages/homepages/index.blade.php @@ -0,0 +1,16 @@ +@extends('bo.layout') + +@section('title', + Str::of(__('models.classes.homepage'))->plural()->ucfirst()) +@section('description', trans_choice('crud.meta.description.index', 0, ['model' => Str::plural(__('models.classes.homepage'))])) + +@section('content') + <div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap"> + @include('modules.breadcrumbs.breadcrumb-body') + </div> + @include('bo.modules.search-bar') + <div class="table-responsive mb-3"> + @include('bo.pages.homepages.index-list') + </div> + {{ $homepageModels->links() }} +@endsection diff --git a/routes/breadcrumbs-bo.php b/routes/breadcrumbs-bo.php index d4659fe..264d470 100644 --- a/routes/breadcrumbs-bo.php +++ b/routes/breadcrumbs-bo.php @@ -2,6 +2,7 @@ use App\Models\ActivityLog; use App\Models\Commitment; +use App\Models\Homepage; use App\Models\Range; use App\Models\SeasonalSection; use App\Models\StaticPage; @@ -113,3 +114,15 @@ Breadcrumbs::for('bo.seasonalsections.duplicate', function (Generator $trail) { $trail->parent('bo.seasonalsections.index'); $trail->push(Str::ucfirst(trans('crud.actions.duplicate'))); }); + +// * HOMEPAGES +Breadcrumbs::for('bo.homepages.index', function (Generator $trail) { + $trail->push( + Str::of(trans('models.classes.homepage'))->plural()->ucfirst(), + route('bo.homepages.index', ['sort_col' => 'updated_at', 'sort_way' => 'desc']) + ); +}); +Breadcrumbs::for('bo.homepages.edit', function (Generator $trail, Homepage $homepage) { + $trail->parent('bo.homepages.index'); + $trail->push(Str::ucfirst(trans('crud.actions.edit')), route('bo.homepages.edit', $homepage)); +}); diff --git a/routes/web-bo.php b/routes/web-bo.php index 6ab8d2a..860f3ef 100644 --- a/routes/web-bo.php +++ b/routes/web-bo.php @@ -3,6 +3,7 @@ use App\Http\Controllers\Bo\ActivityLogsController; use App\Http\Controllers\Bo\CommitmentController; use App\Http\Controllers\Bo\DashboardController; +use App\Http\Controllers\Bo\HomepageController; use App\Http\Controllers\Bo\StaticPageController; use App\Http\Controllers\Bo\RangeController; use App\Http\Controllers\Bo\SeasonalSectionController; @@ -88,6 +89,11 @@ Route::prefix('bo') SeasonalSectionController::class, 'duplicate' ])->name('seasonalsections.duplicate'); + // * HOMEPAGE + Route::resource('homepages', HomepageController::class)->only(['index', 'edit', 'update']) + ->withoutMiddleware('htmlsanitize') + ->middleware('htmlsanitize:presentation_content'); + Route::middleware('can:isConceptor')->group(function () { // * ACTIVITY LOGS. Route::resource('activity_logs', ActivityLogsController::class)->only(['index', 'show']);