File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,10 @@ Via Composer
16
16
``` bash
17
17
$ composer require merodiro/settings
18
18
```
19
+
19
20
publish config through
21
+ Optional: only if you want to edit cache configurations
22
+
20
23
``` bash
21
24
$ php artisan vendor:publish --provider=Merodiro\S ettings\S ettingsServiceProvider
22
25
```
@@ -56,10 +59,18 @@ Settings::flush();
56
59
57
60
### Get all settings
58
61
Returns all settings stored in key => value array
62
+
59
63
``` php
60
64
$settings = Settings::all();
61
65
```
62
66
67
+ ### Get value from blade template
68
+
69
+ ``` php
70
+ <h1 >@settings('site-name')</h1 >
71
+ <h1 >@settings('site-name', 'default name')</h1 >
72
+ ```
73
+
63
74
### Cache all settings
64
75
Caches all settings for the duration that has been set in settings.php config file
65
76
@@ -73,14 +84,6 @@ php artisan settings:cache
73
84
php artisan settings:clear
74
85
```
75
86
76
- ### Get value from blade template
77
-
78
- ``` php
79
- <h1 >@settings('site-name')</h1 >
80
- <h1 >@settings('site-name', 'default name')</h1 >
81
- ```
82
-
83
-
84
87
## Testing
85
88
86
89
``` bash
Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ public function boot()
18
18
__DIR__ .'/config/settings.php ' => config_path ('settings.php ' ),
19
19
], 'config ' );
20
20
21
+ $ this ->mergeConfigFrom (
22
+ __DIR__ .'/config/settings.php ' ,
23
+ 'settings '
24
+ );
25
+
21
26
$ this ->loadMigrationsFrom (__DIR__ . '/migrations ' );
22
27
23
28
if ($ this ->app ->runningInConsole ()) {
You can’t perform that action at this time.
0 commit comments