Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ligonsker's avatar

Changing app name in .env - any implications?

I want to change the app name in the .env file Either manually editing APP_NAME or using the artisan command php artisan app:name.

Edit: I just noticed there is no more app:name command for the newer Laravel versions.

Are there any side effects it might cause? Or it's safe to do it?

0 likes
7 replies
chahal's avatar
chahal
Best Answer
Level 4

Yes, It is completely safe. There are no side effects. Just remember, if you have space in the app name, just put them in quotes.

And If it doesn't get updated, run php artisan config:clear

1 like
Sinnbeck's avatar

No feel free to change that. You are meant to change it. But adding "" around it might be a good idea

1 like
Ligonsker's avatar

@Sinnbeck Yep my first attempt failed because I did not have it since it was with space :D

Snapey's avatar

Edit: I just noticed there is no more app:name command for the newer Laravel versions.

This is to change the namespace of your application (everything that starts App\). It is nothing to do with the URL

2 likes
Ligonsker's avatar

@sinnbeck @dev-chahal @snapey Also, is there any difference between directly naming the app in config/app.php or redirect it from there to ENV:

'name' => 'My App'

vs

'name' => env('APP_NAME', 'fallback_name')
Sinnbeck's avatar

@Ligonsker only that using env let's you set it on a environment based basis. Same as any env value

1 like

Please or to participate in this conversation.