Example[edit | edit source]
First you have to create a file constants.php and it is a good practice to create this file inside app/config/ folder. You can also add constants.php file in compose.json file.
Array based constants inside the file:
return [ 'CONSTANT' => 'This is my first constant.' ];
And you can get this constant by including the facade
Then get the value by constant name
CONSTANT like below :
And the result would be the value :
This is my first constant.