Backups install
This commit is contained in:
@@ -12,7 +12,8 @@ class Kernel extends ConsoleKernel
|
||||
*/
|
||||
protected function schedule(Schedule $schedule): void
|
||||
{
|
||||
// $schedule->command('inspire')->hourly();
|
||||
// $schedule->command('backup:clean')->daily()->at('01:00');
|
||||
// $schedule->command('backup:run')->daily()->at('01:30');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -79,6 +79,18 @@ class User extends Authenticatable
|
||||
return $this->email === 'nurmuhammet@mail.com';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if user is super admin.
|
||||
*/
|
||||
public function isSuperAdmin(): bool
|
||||
{
|
||||
if ($this->isMe()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->hasRole('superadmin');
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if user is admin.
|
||||
*/
|
||||
|
||||
@@ -23,6 +23,7 @@ use Laravel\Nova\Menu\MenuItem;
|
||||
use Laravel\Nova\Menu\MenuSection;
|
||||
use Laravel\Nova\Nova;
|
||||
use Laravel\Nova\NovaApplicationServiceProvider;
|
||||
use Spatie\BackupTool\BackupTool;
|
||||
|
||||
class NovaServiceProvider extends NovaApplicationServiceProvider
|
||||
{
|
||||
@@ -87,6 +88,9 @@ class NovaServiceProvider extends NovaApplicationServiceProvider
|
||||
LocaleSwitcher::make()
|
||||
->setLocales(config('app.locales'))
|
||||
->onSwitchLocale(NovaRepo::localeSwitcherSave()),
|
||||
|
||||
BackupTool::make()
|
||||
->canSee(fn () => auth()->user()->isSuperAdmin()),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -128,6 +132,11 @@ class NovaServiceProvider extends NovaApplicationServiceProvider
|
||||
MenuItem::resource(Branch::class),
|
||||
])->collapsable(),
|
||||
])->icon('cog')->collapsable(),
|
||||
|
||||
MenuSection::make(__('Backups'))
|
||||
->path('/backups')
|
||||
->icon('server')
|
||||
->canSee(fn () => auth()->user()->isSuperAdmin()),
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user