File: /home/eslinced-103/brise-edu.or.kr/app/Stubs/ServiceProvider.stub
<?php
namespace {{namespace}};
use App\Providers\AbstractPackageProvider;
use Illuminate\Support\Facades\Route;
use Laravel\Nova\Events\ServingNova;
use Laravel\Nova\Nova;
class {{className}}ServiceProvider extends AbstractPackageProvider
{
protected string $namespace = "{{namespace}}";
public function register(): void
{
$this->app->booted(function () {
$this->routes();
});
}
protected function routes(): void
{
if ($this->app->routesAreCached()) {
return;
}
Route::middleware(['nova'])
->prefix('api/{{uriKey}}')
->group(__DIR__.'/Routes/api.php');
}
public function boot(): void
{
$this->loadMigrationsFrom(__DIR__ .'/Database/migrations');
Nova::serving(function (ServingNova $event) {
Nova::resources($this->resources(__DIR__));
Nova::dashboards($this->dashboards());
Nova::tools($this->tools());
Nova::script('{{uriKey}}', __DIR__.'/dist/js/{{uriKey}}.js');
Nova::style('{{uriKey}}', __DIR__.'/dist/css/{{uriKey}}.css');
});
}
/**
* Here you can register your dashboards
*/
protected function dashboards(): array
{
return [];
}
/**
* Here you can register your tools connected to module
*/
protected function tools(): array
{
return [];
}
}