HEX
Server: nginx/1.28.3
System: Linux lightweb-s1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64
User: drdrivek-71 (1047)
PHP: 8.3.30
Disabled: NONE
Upload Files
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 [];
    }
}