diff --git a/app/Http/Controllers/Bo/LogoController.php b/app/Http/Controllers/Bo/LogoController.php index 6393193..0184398 100644 --- a/app/Http/Controllers/Bo/LogoController.php +++ b/app/Http/Controllers/Bo/LogoController.php @@ -32,7 +32,7 @@ class LogoController extends Controller $logoModels = Logo::query(); /** @var string $search Search field */ - $search = $request->search; + $search = $request->input('search'); if ($search) { $this->searchQuery( $logoModels, diff --git a/app/Http/Controllers/Bo/NewsController.php b/app/Http/Controllers/Bo/NewsController.php index b45dafc..72ca6b6 100644 --- a/app/Http/Controllers/Bo/NewsController.php +++ b/app/Http/Controllers/Bo/NewsController.php @@ -37,7 +37,7 @@ class NewsController extends Controller $newsModels = News::query(); /** @var string $search Search field */ - $search = $request->search; + $search = $request->input('search'); if ($search) { $this->searchQuery( $newsModels, diff --git a/app/Http/Controllers/Bo/SectionController.php b/app/Http/Controllers/Bo/SectionController.php index 987b88a..517d6ca 100644 --- a/app/Http/Controllers/Bo/SectionController.php +++ b/app/Http/Controllers/Bo/SectionController.php @@ -49,7 +49,7 @@ class SectionController extends Controller } /** @var string $search Search field */ - $search = $request->search; + $search = $request->input('search'); if ($search) { $this->searchQuery( $query, diff --git a/app/Http/Controllers/Bo/SiteController.php b/app/Http/Controllers/Bo/SiteController.php index 693ac4b..382c043 100644 --- a/app/Http/Controllers/Bo/SiteController.php +++ b/app/Http/Controllers/Bo/SiteController.php @@ -36,7 +36,7 @@ class SiteController extends Controller $siteModels = Site::query(); /** @var string $search Search field */ - $search = $request->search; + $search = $request->input('search'); if ($search) { $this->searchQuery( $siteModels, diff --git a/app/Http/Controllers/Bo/SlideController.php b/app/Http/Controllers/Bo/SlideController.php index fb2b69b..7d8beaa 100644 --- a/app/Http/Controllers/Bo/SlideController.php +++ b/app/Http/Controllers/Bo/SlideController.php @@ -32,7 +32,7 @@ class SlideController extends Controller $slideModels = Slide::query(); /** @var string $search Search field */ - $search = $request->search; + $search = $request->input('search'); if ($search) { $this->searchQuery( $slideModels, diff --git a/app/Http/Controllers/Bo/StaticPageController.php b/app/Http/Controllers/Bo/StaticPageController.php index c535e92..25f0e08 100644 --- a/app/Http/Controllers/Bo/StaticPageController.php +++ b/app/Http/Controllers/Bo/StaticPageController.php @@ -31,7 +31,7 @@ class StaticPageController extends Controller $query = StaticPage::query(); /** @var string $search Search field */ - $search = $request->search; + $search = $request->input('search'); if ($search) { $this->searchQuery( $query, diff --git a/app/Http/Controllers/Bo/StripController.php b/app/Http/Controllers/Bo/StripController.php index c03f244..5d741c9 100644 --- a/app/Http/Controllers/Bo/StripController.php +++ b/app/Http/Controllers/Bo/StripController.php @@ -36,7 +36,7 @@ class StripController extends Controller $stripModels = Strip::query()->with('news'); /** @var string $search Search field */ - $search = $request->search; + $search = $request->input('search'); if ($search) { $this->searchQuery( $stripModels, diff --git a/app/Http/Controllers/Bo/TestimonialController.php b/app/Http/Controllers/Bo/TestimonialController.php index c016cc7..fd91503 100644 --- a/app/Http/Controllers/Bo/TestimonialController.php +++ b/app/Http/Controllers/Bo/TestimonialController.php @@ -32,7 +32,7 @@ class TestimonialController extends Controller $testimonialModels = Testimonial::query(); /** @var string $search Search field */ - $search = $request->search; + $search = $request->input('search'); if ($search) { $this->searchQuery( $testimonialModels, diff --git a/app/Http/Controllers/Bo/UserController.php b/app/Http/Controllers/Bo/UserController.php index 9c52949..0894f69 100644 --- a/app/Http/Controllers/Bo/UserController.php +++ b/app/Http/Controllers/Bo/UserController.php @@ -35,7 +35,7 @@ class UserController extends Controller $userModels = User::query(); /** @var string $search Search field */ - $search = $request->search; + $search = $request->input('search'); if ($search) { $this->searchQuery( $userModels, diff --git a/app/Http/Controllers/Fo/NewsController.php b/app/Http/Controllers/Fo/NewsController.php index c6d76cb..0eb2d85 100644 --- a/app/Http/Controllers/Fo/NewsController.php +++ b/app/Http/Controllers/Fo/NewsController.php @@ -27,7 +27,6 @@ class NewsController extends Controller ->fragment('corpo'); $lifeSection = $sectionModels->where('section', PageSectionEnum::move_life)->first(); $commitmentSection = $sectionModels->where('section', PageSectionEnum::move_commitments)->first(); - return view('fo.pages.news.index', \compact( 'staticPageModel', 'sectionModels', @@ -46,10 +45,7 @@ class NewsController extends Controller public function show(News $news): \Illuminate\Contracts\View\View { // Get only id from published news. - // @phpcs:disabled - // @phpstan-ignore-next-line $publishedNews = News::query()->where('published', true)->orderBy('publish_at', 'DESC')->get()->pluck('id'); - // @phpcs:enable // Search the position of the current news id. $positionId = \array_search($news->id, $publishedNews->toArray()); // Check if it's the last position. diff --git a/app/Http/Requests/Fo/ListenFormRequest.php b/app/Http/Requests/Fo/ListenFormRequest.php index 6f48617..fcf993f 100644 --- a/app/Http/Requests/Fo/ListenFormRequest.php +++ b/app/Http/Requests/Fo/ListenFormRequest.php @@ -43,20 +43,20 @@ class ListenFormRequest extends FormRequest 'phone' => [ 'present', 'nullable', - !is_null(request()->country) ? - (Country::make(request()->country)->value === Country::france->value ? + !is_null(request()->input('country')) ? + (Country::make(request()->input('country'))->value === Country::france->value ? 'phone:FR|max:25' : - 'number|max:50') : - 'number|max:50' + 'numeric|max:50') : + 'numeric|max:50' ], 'postal_code' => [ 'present', 'nullable', - !is_null(request()->country) ? - (Country::make(request()->country)->value === Country::france->value ? + !is_null(request()->input('country')) ? + (Country::make(request()->input('country'))->value === Country::france->value ? 'postal_code:FR|max:25' : - 'number|max:50') : - 'number|max:50' + 'numeric|max:50') : + 'numeric|max:50' ], 'city' => 'present|nullable|string|between:3,20', 'country' => ['present', 'nullable', new Enum(Country::class)], diff --git a/resources/views/fo/pages/news/card.blade.php b/resources/views/fo/pages/news/card.blade.php index 38ecf3d..f2f7d45 100644 --- a/resources/views/fo/pages/news/card.blade.php +++ b/resources/views/fo/pages/news/card.blade.php @@ -1,9 +1,10 @@ +
{{ $news->thumbnail_alt }}

- {{ str($news->publish_at->locale('fr_FR')->isoFormat('D MMMM Y'))->upper() }} + {{ str($news->displayed_date->locale('fr_FR')->isoFormat('D MMMM Y'))->upper() }}

{{ $news->title }} diff --git a/resources/views/fo/pages/news/show.blade.php b/resources/views/fo/pages/news/show.blade.php index 258ff96..2977ff2 100644 --- a/resources/views/fo/pages/news/show.blade.php +++ b/resources/views/fo/pages/news/show.blade.php @@ -15,7 +15,7 @@

-

{{ str($news->publish_at->locale('fr_FR')->isoFormat('D MMMM Y'))->upper() }} +

{{ str($news->displayed_date->locale('fr_FR')->isoFormat('D MMMM Y'))->upper() }}