Laravel 6 Define Global Constants Config PHP file

Today, We want to share with you Laravel 6 Define Global Constants Config PHP file.In this post we will show you How to Define Constant Variable in Laravel 6?, hear for How to define Global or constant Variables in Laravel 6 we will give you demo and example for implement.In this post, we will learn about Laravel define global constants Config php file with an example.

Laravel 6 Define Global Constants Config PHP

There are the Following The simple About Laravel6 Define Global Constants Config PHP file Full Information With Example and source code.

As I will cover this Post with live Working example to develop Simple Laravel 6 Define Constant Variable, so the Create and use constants in laravel 6 Examples is following below.

Laravel 6 Create A Config File

first of all I need to make a simple file Like name as a global.php config file with define constants variable data value as well as We can also simple define array value like as bellow Examples:


return [
    'support_email_address' => '[email protected]',
    'role_type' => ['Manager', 'Admin', 'User'],

Laravel 6 Use Constant Variable


We can simplay fetch the value using config() data helper. We can simple bellow laravel 6 example:

Route::get('get-all-role-type', function()

Route::get('get-support-email', function()

Web Programming Tutorials Example with Demo

Read :


You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about PHP Laravel6 Define Global Constants Config PHP file.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, donโ€™t forget to share.