Stelle das U0-Fundament mit CMS, Mitgliedern und Filament bereit.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
89b35ac480
commit
2035c46edd
130 files changed
+18519
-50
No files matched your search
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Domain\Cms\NavigationItem;
|
||||
use App\Domain\Cms\NavigationItemPolicy;
|
||||
use App\Domain\Cms\Page;
|
||||
use App\Domain\Cms\PagePolicy;
|
||||
use App\Models\User;
|
||||
use App\Policies\UserPolicy;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function register(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
{
|
||||
Gate::policy(Page::class, PagePolicy::class);
|
||||
Gate::policy(NavigationItem::class, NavigationItemPolicy::class);
|
||||
Gate::policy(User::class, UserPolicy::class);
|
||||
|
||||
View::composer('layouts.site', function ($view): void {
|
||||
if (! array_key_exists('navigation', $view->getData())) {
|
||||
$view->with('navigation', NavigationItem::query()->with('page')->orderBy('sort_order')->orderBy('id')->get());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user