Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akiyamasm/laravel-nova-configuration
Use Configuration inputs instead of the env/config files. Good news for the clients!
https://github.com/akiyamasm/laravel-nova-configuration
Last synced: 8 days ago
JSON representation
Use Configuration inputs instead of the env/config files. Good news for the clients!
- Host: GitHub
- URL: https://github.com/akiyamasm/laravel-nova-configuration
- Owner: akiyamaSM
- Created: 2018-09-10T08:28:11.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-13T13:15:32.000Z (over 5 years ago)
- Last Synced: 2024-10-20T11:53:07.326Z (about 1 month ago)
- Language: Vue
- Homepage:
- Size: 42 KB
- Stars: 40
- Watchers: 3
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# laravel-nova-configuration
Use Configuration inputs instead of the env/config files. Good news for the clients!
![nova-conf](https://user-images.githubusercontent.com/12276076/46549393-bb3b2f80-c8c9-11e8-9b43-b217dc4879e0.png)## Requirements
Laravel Nova.
# Installation
First install the [Nova](https://nova.laravel.com) package via composer:
```bash
composer require inani/laravel-nova-configuration
```Next up, you must register the tool via the `tools` method of the `NovaServiceProvider`.
```php
// inside app/Providers/NovaServiceProvder.php// ...
public function tools()
{
return [
// ...
new \Inani\LaravelNovaConfiguration\LaravelNovaConfiguration()
];
}
```Publish the config file:
``` bash
php artisan vendor:publish --provider="Inani\LaravelNovaConfiguration\ToolServiceProvider"
```Then run the migration
``` bash
php artisan migrate
```# Usage
## In the back office
After installing the tool, you should see the new sidebar navigation item for `Packages Configuration`.
And then just you have to manipulate the settings.## In the code
```php
use Inani\LaravelNovaConfiguration\Helpers\Configuration;// Get the value of the API_GOOGLE key, null if it doesn't exist
$value = Configuration::get('API_GOOGLE');// Get the value of the FOO key, 'BAR' if it doesn't exist
$value = Configuration::get('FOO', 'BAR);
```#### Updating the sidebar bar label
If you want to update the display name of the tool in the Laravel Nova sidebar, You can simply update the `sidebar-label` in the following file
```
resources/views/laravel-nova-configuration/navigation.blade.php
```
Enjoy coding.