Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

global constant 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')
 
PREVIOUS NEXT
Tagged: #global #constant #variable #laravel
ADD COMMENT
Topic
Name
9+4 =