I believe app name is only used in presentation. Also, it's a string, so it shouldn't be a problem to set it to anything you like.
Laravel config application name
I have a question that might be kinda newbie but I don't know then I have to ask.
I'm using config('app.name') on my html to set the title of my website based on what is set to that config variable, but I was wondering... Is it allowed to have spaces? And also, can I set the entire subtitle such as: My Website - The best website you'll ever find? Or it's going to be a problem later cause this variable is used somewhere down the code that won't support that?
@yijani Set it in the same file:
<!-- config/app.php -->
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
*/
'name' => 'Your App Name',
'subtitle' => 'Your app’s subtitle',
// Other configuration settings...
];
And then use them in your Blade views:
<title>{{ config('app.name') }} - {{ config('app.subtitle') }}</title>
As soon as you include the subtitle in the app.name configuration value, you’re going to find an instance where you’re go, “Damn, I wish I could get just the app’s name, not the app’s name and subtitle.”
One scenario I can think of is copyright notices:
<p>© {{ date('Y') }} {{ config('app.name') }}. All rights reserved.</p>
You don’t want your site’s subtitle printed there; just the app name.
Please or to participate in this conversation.