Laravel define global constants Config php file

Laravel 5.7 sub-directories
config directory
<?phpreturn ['A' => valueA,'B' => valueB,];
<?phpreturn ['name' => env('APP_NAME', 'Laravel'),'env' => env('APP_ENV', 'production'),];
config('app.name');
config('app.env');
$name= Config::get(‘app.name’);
use Illuminate\Support\Facades\Config;
\Config::get(‘app.name’);

Note 1:

php artisan config:cache

Note 2:

Config::set('foo.bar', 'test');
config(['foo.bar' => 'test']);

Note 3:

<?phpreturn ['bar' => [           'A' => valueA,           'B' => valueB,
],
];
Config::get('foo.bar.A');
Config::get('foo.bar.B');

Previous Stories You will Love:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Panjeh

Panjeh

Posting about Python and Laravel