Search
 
SCRIPT & CODE EXAMPLE
 

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')
Comment

PREVIOUS NEXT
Code Example
Php :: find_in_set in laravel 
Php :: Convert an Integer Into a String in PHP 
Php :: wordpress basic auth 
Php :: laravel relationship 
Php :: php backend generator 
Php :: laravel create command tutorial 
Php :: tag php 
Php :: laravel upload image 
Php :: download html table to excel 
Php :: php locale 
Php :: laravel routes 
Php :: run laravel without php artisan serve 
Php :: cron job setting for laravel in cpanel 
Php :: generate shortcode wordpress plugin 
Php :: PHP Custom Time Ago Function 
Php :: php mail merge docx document 
Php :: php how to check if user has a role on login 
Php :: codeigniter ellipsis in php read more text 
Php :: Laravel Http client throw exception if request is not successful 
Php :: cookie or session authentication instead of HTTP Basic authentication makes it much easier for users to log out 
Php :: SymfonyStyle 
Php :: How to send JSON format data in postman to django models that have a foreign key to another model 
Php :: confiruando passaport no laravel 
Php :: command working in terminal but working from code php 
Php :: test not found page symfiny in dev 
Php :: pregmatch 
Php :: visual studio php dollar sign double click 
Php :: how to lookup value object php 
Php :: laravel handle image validation 
Php :: blocking youtube adds in php 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =