79 lines
1.9 KiB
PHP
79 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace Modules\Withdraw\Providers;
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
|
|
|
class RouteServiceProvider extends ServiceProvider
|
|
{
|
|
|
|
/**
|
|
* @var string $moduleName
|
|
*/
|
|
protected string $moduleName = 'Withdraw';
|
|
|
|
/**
|
|
* The module namespace to assume when generating URLs to actions.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $moduleNamespace = 'Modules\Withdraw\Http\Controllers';
|
|
|
|
/**
|
|
* Called before routes are registered.
|
|
* Register any model bindings or pattern based filters.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
parent::boot();
|
|
}
|
|
|
|
/**
|
|
* Define the routes for the application.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function map()
|
|
{
|
|
$this->mapApiRoutes();
|
|
|
|
$this->mapAdminRoutes();
|
|
}
|
|
|
|
/**
|
|
* Define the "web" routes for the application.
|
|
* These routes all receive session state, CSRF protection, etc.
|
|
*
|
|
* @return void
|
|
*/
|
|
protected function mapAdminRoutes()
|
|
{
|
|
Route::as(config('admin.route.as'))
|
|
->domain(config('admin.route.domain'))
|
|
->middleware(config('admin.route.middleware'))
|
|
->namespace($this->moduleNamespace.'\\Admin')
|
|
->prefix(config('admin.route.prefix'))
|
|
->group(module_path($this->moduleName, 'Routes/admin.php'));
|
|
}
|
|
|
|
/**
|
|
* Define the "api" routes for the application.
|
|
* These routes are typically stateless.
|
|
*
|
|
* @return void
|
|
*/
|
|
protected function mapApiRoutes()
|
|
{
|
|
Route::as(config('api.route.as'))
|
|
->domain(config('api.route.domain'))
|
|
->middleware(config('api.route.middleware'))
|
|
->namespace($this->moduleNamespace.'\\Api')
|
|
->prefix(config('api.route.prefix').'/withdraws')
|
|
->group(module_path($this->moduleName, 'Routes/api.php'));
|
|
}
|
|
|
|
}
|