Search
 
SCRIPT & CODE EXAMPLE
 

PHP

How to use my constants in Larvel

Create a file constants.php inside app/config/ and put your settings in an array:

<?php
//file : app/config/constants.php

return [
	'ADMIN_NAME' => 'administrator'
];

Then anywhere in your controllers or views you can get the value by using Config Facade:

echo Config::get('constants.ADMIN_NAME');
Comment

PREVIOUS NEXT
Code Example
Php :: define function parameters php 
Php :: send attachment in mail php 
Php :: laravel curl package 
Php :: validation error laravel 8 with custom massage 
Php :: php exec without waiting 
Php :: laravel check if record exists 
Php :: session laravel 
Php :: laravel collection slice 
Php :: get data based on date in laravel 
Php :: php call class dynamically 
Php :: laravel show debug query sql 
Php :: cloudinary laravel 
Php :: default value date symfony entity 
Php :: php laravel between dates 
Php :: nova laravel image 
Php :: How to check if email exists in laravel validaton 
Php :: collapse open by default 
Php :: eloquent update row response 
Php :: get current month php 
Php :: php shell_exec with root 
Php :: yii2 gridview filter exact value 
Php :: phpspreadsheet set cell by column and row 
Php :: Laravel Code To Rename file on server in the storage folder 
Php :: regex get text between braces 
Php :: how to insert multiple selected checkbox values in database in php 
Php :: send axios request to php 
Php :: take 10 skip 10 laravel 
Php :: laravel required_if 
Php :: php time() function 
Php :: php day of week full name 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =