diff --git a/README.md b/README.md index bc84816..87f3a1b 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,11 @@ You can use this package as default laravel config() function! } ``` +or Blade directive @lssconfig +```php + @lssconfig('group.setting') +``` + ## Usage with MoonShine Laravel Admin Please see [MoonShine](https://moonshine.cutcode.ru/) diff --git a/src/LaravelSiteSettingsProvider.php b/src/LaravelSiteSettingsProvider.php index dc5a1c6..719f8c6 100644 --- a/src/LaravelSiteSettingsProvider.php +++ b/src/LaravelSiteSettingsProvider.php @@ -2,6 +2,7 @@ namespace VI\LaravelSiteSettings; +use Illuminate\Support\Facades\Blade; use Illuminate\Support\ServiceProvider; use VI\LaravelSiteSettings\Models\LaravelSiteSetting; use VI\LaravelSiteSettings\Models\LaravelSiteSettingGroup; @@ -37,6 +38,10 @@ public function boot() } + Blade::directive('lssconfig', function (...$expression) { + return ""; + }); + LaravelSiteSetting::observe(LSSObserver::class); LaravelSiteSettingGroup::observe(LSSObserver::class);