afb5011fbe
[BREAKING] — REMOVES REMOTE API A new API will need to be implemented properly using the new Laravel Passport OAuth2 system. DingoAPI was becoming too unstable and development wasn’t really moving along enough to continue to rely on it.
79 lines
2 KiB
PHP
79 lines
2 KiB
PHP
<?php
|
|
|
|
namespace Pterodactyl\Providers;
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
|
|
|
class RouteServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* This namespace is applied to the controller routes in your routes file.
|
|
*
|
|
* In addition, it is set as the URL generator's root namespace.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $namespace = 'Pterodactyl\Http\Controllers';
|
|
|
|
/**
|
|
* Define your route model bindings, pattern filters, etc.
|
|
*
|
|
* @param \Illuminate\Routing\Router $router
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
//
|
|
|
|
parent::boot();
|
|
}
|
|
|
|
/**
|
|
* Define the routes for the application.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function map()
|
|
{
|
|
$this->mapWebRoutes();
|
|
$this->mapApiRoutes();
|
|
}
|
|
/**
|
|
* Define the "web" routes for the application.
|
|
*
|
|
* These routes all receive session state, CSRF protection, etc.
|
|
*
|
|
* @return void
|
|
*/
|
|
protected function mapWebRoutes()
|
|
{
|
|
Route::group([
|
|
// 'middleware' => 'web',
|
|
'namespace' => $this->namespace,
|
|
], function ($router) {
|
|
foreach (glob(app_path('Http//Routes') . '/*.php') as $file) {
|
|
$this->app->make('Pterodactyl\\Http\\Routes\\' . basename($file, '.php'))->map($router);
|
|
}
|
|
});
|
|
}
|
|
/**
|
|
* Define the "api" routes for the application.
|
|
*
|
|
* These routes are typically stateless.
|
|
*
|
|
* @return void
|
|
*/
|
|
protected function mapApiRoutes()
|
|
{
|
|
Route::group([
|
|
'middleware' => 'api',
|
|
'namespace' => $this->namespace,
|
|
'prefix' => 'api',
|
|
], function ($router) {
|
|
foreach (glob(app_path('Http//Routes//Api') . '/*.php') as $file) {
|
|
$this->app->make('Pterodactyl\\Http\\Routes\\Api\\' . basename($file, '.php'))->map($router);
|
|
}
|
|
});
|
|
}
|
|
}
|