WIp
This commit is contained in:
1 parent
a3771218f0
commit
445884782a
12 files changed
+404
-30
No files matched your search
@@ -31,6 +31,14 @@
|
||||
|
||||
class NovaServiceProvider extends NovaApplicationServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
Nova::initialPath(NovaRepo::initialPath());
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*/
|
||||
@@ -39,7 +47,7 @@ public function boot(): void
|
||||
parent::boot();
|
||||
|
||||
Nova::withBreadcrumbs();
|
||||
Nova::footer(fn () => view('vendor.nova.partials.footer')->render());
|
||||
Nova::footer(NovaRepo::footer());
|
||||
|
||||
$this->setupNavigation();
|
||||
$this->setupUserNavigation();
|
||||
@@ -66,9 +74,7 @@ protected function routes(): void
|
||||
*/
|
||||
protected function gate(): void
|
||||
{
|
||||
Gate::define('viewNova', function ($user) {
|
||||
return $user->isSystemUser() || $user->phoneIsVerified();
|
||||
});
|
||||
Gate::define('viewNova', NovaRepo::viewNova());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,23 +98,15 @@ public function tools(): array
|
||||
->onSwitchLocale(NovaRepo::localeSwitcherSave()),
|
||||
|
||||
BackupTool::make()
|
||||
->canSee(fn () => auth()->user()->isMe()),
|
||||
->canSee(NovaRepo::isMe()),
|
||||
|
||||
LogsTool::make()
|
||||
->canSee(fn () => Gate::allows('isMe', auth()->user()))
|
||||
->canDownload(fn () => Gate::allows('isMe', auth()->user()))
|
||||
->canDelete(fn () => Gate::allows('isMe', auth()->user())),
|
||||
->canSee(NovaRepo::isMe())
|
||||
->canDownload(NovaRepo::isMe())
|
||||
->canDelete(NovaRepo::isMe()),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Register any application services.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup navigation
|
||||
*/
|
||||
@@ -165,7 +163,7 @@ public function setupNavigation(): void
|
||||
public function setupUserNavigation(): void
|
||||
{
|
||||
Nova::userMenu(function (Request $request, Menu $menu) {
|
||||
$menu->prepend(MenuItem::make(__('My Profile'), sprintf('/resources/users/%s', $request->user()->id)));
|
||||
$menu->prepend(MenuItem::make(__('My Profile'), $request->user()->profilePage()));
|
||||
|
||||
return $menu;
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user