Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

global variable in laravel

//create globals.php file in laravel/config/ and add the ff:

<?php
return [
    'user_type' => [
          'administrator' => 1,
          'hr'            => 2,
          'employee'      => 3
    ]
];

//then you can call it in your controllers or blade using
config('globals.user_type.employee')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #global #variable #laravel
ADD COMMENT
Topic
Name
4+5 =