2015-12-06 18:58:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Routes;
|
|
|
|
|
|
|
|
use Illuminate\Routing\Router;
|
|
|
|
|
|
|
|
class RestRoutes {
|
|
|
|
|
|
|
|
public function map(Router $router) {
|
2016-01-04 21:09:39 +00:00
|
|
|
$router->group([
|
|
|
|
'prefix' => 'api/v1',
|
|
|
|
'middleware' => [
|
|
|
|
'api'
|
|
|
|
]
|
|
|
|
], function () use ($router) {
|
|
|
|
// Users endpoint for API
|
|
|
|
$router->group(['prefix' => 'users'], function () use ($router) {
|
|
|
|
// Returns all users
|
|
|
|
$router->get('/', [
|
|
|
|
'uses' => 'API\UserController@getAllUsers'
|
|
|
|
]);
|
|
|
|
|
|
|
|
// Return listing of user [with only specified fields]
|
|
|
|
$router->get('/{id}/{fields?}', [
|
|
|
|
'uses' => 'API\UserController@getUser'
|
|
|
|
])->where('id', '[0-9]+');
|
2015-12-06 18:58:49 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|