From 85c13594d40357e51855c51cf267c0f5d3c4baaf Mon Sep 17 00:00:00 2001 From: Antonio Almeida Date: Tue, 30 Apr 2024 15:06:05 +0100 Subject: [PATCH] Refactor PageTrait to use Illuminate\Support\Facades\Config instead of \Config --- src/app/Http/Controllers/Traits/PageTrait.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/Http/Controllers/Traits/PageTrait.php b/src/app/Http/Controllers/Traits/PageTrait.php index 76e32cf..3630999 100644 --- a/src/app/Http/Controllers/Traits/PageTrait.php +++ b/src/app/Http/Controllers/Traits/PageTrait.php @@ -5,13 +5,14 @@ use Cache; use Illuminate\Contracts\View\Factory; use Illuminate\Contracts\View\View; -use Session; +use Illuminate\Support\Facades\Config; +use Illuminate\Support\Facades\Session; trait PageTrait { - public function index(string $slug = 'home', ?string $sub = null): View|Factory + public function index(string $slug = 'home', ?string $sub = null): View | Factory { - $locale = Session::get('locale', \Config::get('app.locale')); + $locale = Session::get('locale', Config::get('app.locale')); $this->data = Cache::rememberForever("page_{$slug}_{$locale}", function () use ($slug) { $page = class_exists(\App\Models\Page::class)