sifangpay/app/Providers/RouteServiceProvider.php

104 lines
2.4 KiB
PHP

<?php
namespace App\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = 'App\Http\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
//
parent::boot();
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->mapWebRoutes();
$this->mapAdminRoutes();
$this->mapPayRoutes();
$this->mapMerchantRoutes();
$this->mapCollectRoutes();
$this->mapApiRoutes();
//
}
protected function mapCollectRoutes()
{
Route::middleware('web')
->namespace($this->namespace.'\Collect')
->group(base_path('routes/collect.php'));
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->namespace.'\Web')
->group(base_path('routes/web.php'));
}
protected function mapPayRoutes()
{
Route::middleware('web')
->namespace($this->namespace.'\Pay')
->group(base_path('routes/pay.php'));
}
protected function mapAdminRoutes()
{
Route::middleware('web')
->namespace($this->namespace.'\Admin')
->group(base_path('routes/admin.php'));
}
protected function mapMerchantRoutes()
{
Route::middleware('web')
->namespace($this->namespace.'\Merchant')
->group(base_path('routes/merchant.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::middleware('web')
->namespace($this->namespace.'\Api')
->group(base_path('routes/api.php'));
}
}