I have set the application name using
php artisan app:name xyz
How can I progmatically access the application name in laravel ?
Naming Your Application After installing Laravel, you may wish to "name" your application. By default, the app directory is namespaced under App , and autoloaded by Composer using the PSR-4 autoloading standard.
The APP_URL is .env file environment variable for your application base path such as your domain http://example.com or http://localhost/{project name}/public if you should store your front page picture public/images folder then call url('images/{picture name}') 3.
You should use php artisan app:name command to rename your app. It will change namespace in all project files for you. This is the only right way to rename your app.
In a fresh Laravel installation, the root directory of your application will contain a .env.example file that defines many common environment variables.
From laravel version 5.3^ there is a function to call the app name
config('app.name');
You can change the default name 'Laravel' inside this file
config/app.php 'name' => 'Laravel',
And also inside .env file
APP_NAME=your_app_name
for latter to work, in config/app.php the line where you set the name should be written like this: 'name' => env('APP_NAME', 'fallback_app_name'),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With