O
O
Outsider V.2017-08-06 12:49:40
Laravel
Outsider V., 2017-08-06 12:49:40

How to register the site name in the settings?

I want to set the name of the site in the settings file, so that I can then display it in the Blade templates. What is the best way to do this? It seems that adding something to config/app.php is not a good idea.
The question is in which file to register and how then to get access from the template.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
cha-cha, 2017-08-06
@Audiophile

Why? You can even write in a separate. For example:

// config/example.php
return [
    'website_name' => 'My Website'
];

// some.blade.php
{{ config('example.website_name') }}

V
Vladislav Dmitruk, 2017-08-07
@webdevlix

Don't you have this prntscr.com/g5kdbv in config/app.php ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question