2024-05-13 18:55:34 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
|
|
use Illuminate\Support\Facades\Gate;
|
|
|
|
use Laravel\Nova\Nova;
|
|
|
|
use Laravel\Nova\NovaApplicationServiceProvider;
|
|
|
|
|
|
|
|
class NovaServiceProvider extends NovaApplicationServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Bootstrap any application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function boot()
|
|
|
|
{
|
|
|
|
parent::boot();
|
|
|
|
|
|
|
|
Nova::withBreadcrumbs();
|
|
|
|
}
|
|
|
|
|
2024-06-19 13:20:51 -04:00
|
|
|
/**
|
|
|
|
* Get the tools that should be listed in the Nova sidebar.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function tools()
|
|
|
|
{
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
2024-05-13 18:55:34 -04:00
|
|
|
/**
|
|
|
|
* Register the Nova routes.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function routes()
|
|
|
|
{
|
|
|
|
Nova::routes()
|
2024-06-01 01:04:04 +00:00
|
|
|
->withAuthenticationRoutes()
|
|
|
|
->withPasswordResetRoutes()
|
|
|
|
->register();
|
2024-05-13 18:55:34 -04:00
|
|
|
}
|
|
|
|
|
2024-06-19 13:20:51 -04:00
|
|
|
/**
|
|
|
|
* Register any application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function register()
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
|
|
|
|
2024-05-13 18:55:34 -04:00
|
|
|
/**
|
|
|
|
* Register the Nova gate.
|
|
|
|
*
|
|
|
|
* This gate determines who can access Nova in non-local environments.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function gate()
|
|
|
|
{
|
|
|
|
Gate::define('viewNova', function ($user) {
|
2024-06-19 13:20:51 -04:00
|
|
|
return $user->isAdmin();
|
2024-05-13 18:55:34 -04:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the dashboards that should be listed in the Nova sidebar.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function dashboards()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
new \App\Nova\Dashboards\Main,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|