plaha
plaha

Reputation: 716

Laravel 5 global settings

I need to create some settings for controller method, accessible in view, for example: ajaxRefreshTime

Now, I found two ways:

  1. Create config file, and use settings (set/get) in controller and view via Config facade
  2. I can add some properties to the base controller, and in the constructor add it to view via View::share

May be there are more interesting ways?

Upvotes: 0

Views: 60

Answers (1)

lewis4u
lewis4u

Reputation: 15027

Normally the global settings are saved in .env file like

APP_NAME
DB_DATABASE

I think this is more a personal preference than a rule. You can save it in app/config also.

Upvotes: 1

Related Questions