2016-09-05 22:21:36 +02:00
|
|
|
<?php
|
2017-11-19 23:30:00 +01:00
|
|
|
|
2018-01-13 03:39:15 +01:00
|
|
|
use Pterodactyl\Models\Node;
|
2018-01-12 05:49:46 +01:00
|
|
|
use Pterodactyl\Models\User;
|
2018-01-13 03:39:15 +01:00
|
|
|
use Pterodactyl\Models\Location;
|
|
|
|
use Pterodactyl\Models\Allocation;
|
2018-01-12 05:49:46 +01:00
|
|
|
|
2017-10-08 01:08:43 +02:00
|
|
|
/*
|
2017-11-19 23:30:00 +01:00
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| User Controller Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
2018-01-20 02:58:57 +01:00
|
|
|
| Endpoint: /api/application/users
|
2017-11-19 23:30:00 +01:00
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => '/users'], function () {
|
2018-01-12 05:49:46 +01:00
|
|
|
Route::bind('user', function ($value) {
|
|
|
|
return User::find($value) ?? new User;
|
|
|
|
});
|
|
|
|
|
2017-11-19 23:30:00 +01:00
|
|
|
Route::get('/', 'Users\UserController@index')->name('api.admin.user.list');
|
2017-12-16 18:31:18 +01:00
|
|
|
Route::get('/{user}', 'Users\UserController@view')->name('api.admin.user.view');
|
2017-11-19 23:30:00 +01:00
|
|
|
|
2017-12-16 18:31:18 +01:00
|
|
|
Route::post('/', 'Users\UserController@store')->name('api.admin.user.store');
|
2018-01-01 22:11:44 +01:00
|
|
|
Route::patch('/{user}', 'Users\UserController@update')->name('api.admin.user.update');
|
2017-11-19 23:30:00 +01:00
|
|
|
|
2017-12-16 18:31:18 +01:00
|
|
|
Route::delete('/{user}', 'Users\UserController@delete')->name('api.admin.user.delete');
|
2017-11-19 23:30:00 +01:00
|
|
|
});
|
2017-12-17 21:57:05 +01:00
|
|
|
|
2018-01-01 22:11:44 +01:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Node Controller Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
2018-01-20 02:58:57 +01:00
|
|
|
| Endpoint: /api/application/nodes
|
2018-01-01 22:11:44 +01:00
|
|
|
|
|
|
|
|
*/
|
2017-12-17 21:57:05 +01:00
|
|
|
Route::group(['prefix' => '/nodes'], function () {
|
2018-01-13 03:39:15 +01:00
|
|
|
Route::bind('node', function ($value) {
|
|
|
|
return Node::find($value) ?? new Node;
|
|
|
|
});
|
|
|
|
|
2017-12-17 21:57:05 +01:00
|
|
|
Route::get('/', 'Nodes\NodeController@index')->name('api.admin.node.list');
|
|
|
|
Route::get('/{node}', 'Nodes\NodeController@view')->name('api.admin.node.view');
|
2018-01-01 22:11:44 +01:00
|
|
|
|
|
|
|
Route::post('/', 'Nodes\NodeController@store')->name('api.admin.node.store');
|
|
|
|
Route::patch('/{node}', 'Nodes\NodeController@update')->name('api.admin.node.update');
|
|
|
|
|
|
|
|
Route::delete('/{node}', 'Nodes\NodeController@delete')->name('api.admin.node.delete');
|
2018-01-11 06:19:03 +01:00
|
|
|
|
|
|
|
Route::group(['prefix' => '/{node}/allocations'], function () {
|
2018-01-13 03:39:15 +01:00
|
|
|
Route::bind('allocation', function ($value) {
|
|
|
|
return Allocation::find($value) ?? new Allocation;
|
|
|
|
});
|
|
|
|
|
2018-01-11 06:19:03 +01:00
|
|
|
Route::get('/', 'Nodes\AllocationController@index')->name('api.admin.node.allocations.list');
|
|
|
|
|
|
|
|
Route::delete('/{allocation}', 'Nodes\AllocationController@delete')->name('api.admin.node.allocations.delete');
|
|
|
|
});
|
2017-12-17 21:57:05 +01:00
|
|
|
});
|
2018-01-04 04:14:53 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Location Controller Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
2018-01-20 02:58:57 +01:00
|
|
|
| Endpoint: /api/application/locations
|
2018-01-04 04:14:53 +01:00
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => '/locations'], function () {
|
2018-01-13 03:39:15 +01:00
|
|
|
Route::bind('location', function ($value) {
|
|
|
|
return Location::find($value) ?? new Location;
|
|
|
|
});
|
|
|
|
|
2018-01-04 04:14:53 +01:00
|
|
|
Route::get('/', 'Locations\LocationController@index')->name('api.admin.location.list');
|
|
|
|
Route::get('/{location}', 'Locations\LocationController@view')->name('api.admin.location.view');
|
|
|
|
|
|
|
|
Route::post('/', 'Locations\LocationController@store')->name('api.admin.location.store');
|
|
|
|
Route::patch('/{location}', 'Locations\LocationController@update')->name('api.admin.location.update');
|
|
|
|
|
|
|
|
Route::delete('/{location}', 'Locations\LocationController@delete')->name('api.admin.location.delete');
|
|
|
|
});
|