I had to declare a variable in AppServiceProvider and shared it to all view to be able to use it everywhere.
AppServiceProvider.php
//the reputation variable
$reputations = array(
'xxx'=>array('value'=>1,'description'=>'yyy')
);
view()->share([
'reputations'=>$reputations]);
now I have a helper file that has some functions also available in all views and controllers. I wish to access the $reputations variable inside Helpers.php
App\Helpers\Helpers.php
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire