jeudi 24 octobre 2019

How to get session variables in config file => laravel 5.8(A facade root has not been set.)

config/global.php
<?php    
use Illuminate\Support\Facades\Session;
$title = Session::has('current_auditor_info.title') ? Session::get('current_auditor_info.title') : "fallback";
$template = Session::has('current_auditor_info.template') ? Session::get('current_auditor_info.template') : "default";

return [
 'global' => array(
                'title'=>    `enter code here`$title,
                'template'=> $template,
 ),
];

I called this way following error came => A facade root has not been set. config/global.php



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire