46 lines
894 B
PHP
46 lines
894 B
PHP
<?php
|
|
|
|
namespace App\Api;
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class ApiServiceProvider extends ServiceProvider
|
|
{
|
|
protected $routeMiddleware = [
|
|
'auth.api' => Middleware\Authenticate::class,
|
|
'checkapi' => Middleware\CheckApi::class,
|
|
];
|
|
|
|
public function boot()
|
|
{
|
|
}
|
|
|
|
public function register()
|
|
{
|
|
$this->registerRouteMiddleware();
|
|
$this->loadAdminRoutes();
|
|
}
|
|
|
|
protected function registerRouteMiddleware()
|
|
{
|
|
foreach ($this->routeMiddleware as $key => $middleware) {
|
|
Route::aliasMiddleware($key, $middleware);
|
|
}
|
|
}
|
|
|
|
protected function loadAdminRoutes()
|
|
{
|
|
Route::middleware('api')
|
|
->domain('mapi.bohaimingpin.com')
|
|
->namespace('App\Api\Controllers')
|
|
->group(__DIR__ . '/routes.php');
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|