Your Own Setting
To create our own setting which might be required for application, place php file inside
settings/configuration directory. Setting file must return array just like as shown below:
return [ 'githubApiKey' => 'GITHUB_API_KEY', 'googleMapKey' => 'GOOGLE_MAPS_KEY' ];
Let's call this file
credentials.php. To fetch value of
githubAppKey from this setting file, use
getSetting method of
Nishchay facade class. See below code for how to fetch setting.
If settings are nested then separate it by dot where first part should be file name without its extension. Let's change above setting to understand how nested can read.
return [ 'github' => [ 'apiUrl' => 'https://api.github.com/', 'apiKey' => 'GITHUB_API_KEY' ] ];
Now to read
apiKey we need to change our parameter to method
Notes are visible to you only and its for your use only. Its good to note a point of what you read.