40 lines
868 B
Plaintext
40 lines
868 B
Plaintext
|
|
<?php
|
||
|
|
|
||
|
|
namespace $NAMESPACE$;
|
||
|
|
|
||
|
|
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||
|
|
use Illuminate\Support\Facades\Route;
|
||
|
|
|
||
|
|
class $CLASS$ extends ServiceProvider
|
||
|
|
{
|
||
|
|
protected string $name = '$MODULE$';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Called before routes are registered.
|
||
|
|
*
|
||
|
|
* Register any model bindings or pattern based filters.
|
||
|
|
*/
|
||
|
|
public function boot(): void
|
||
|
|
{
|
||
|
|
parent::boot();
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Define the routes for the application.
|
||
|
|
*/
|
||
|
|
public function map(): void
|
||
|
|
{
|
||
|
|
$this->mapApiRoutes();
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Define the "api" routes for the application.
|
||
|
|
*
|
||
|
|
* These routes are typically stateless.
|
||
|
|
*/
|
||
|
|
protected function mapApiRoutes(): void
|
||
|
|
{
|
||
|
|
Route::middleware('api')->prefix('api')->name('api.')->group(module_path($this->name, '$API_ROUTES_PATH$'));
|
||
|
|
}
|
||
|
|
}
|