Skip to content

Commit

Permalink
Refactor PageTrait to use Illuminate\Support\Facades\Config instead o…
Browse files Browse the repository at this point in the history
…f \Config
  • Loading branch information
promatik committed Apr 30, 2024
1 parent 063bfa4 commit 85c1359
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/Http/Controllers/Traits/PageTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 85c1359

Please sign in to comment.