2017-06-10 03:47:02 +08:00
|
|
|
<?php
|
|
|
|
/**
|
2017-06-21 22:22:59 +08:00
|
|
|
* Admin Routes
|
2017-06-10 03:47:02 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
Route::group([
|
2017-06-21 22:22:59 +08:00
|
|
|
'namespace' => 'Admin', 'prefix' => 'admin', 'as' => 'admin.',
|
|
|
|
'middleware' => ['role:admin'],
|
|
|
|
], function () {
|
2017-06-10 03:47:02 +08:00
|
|
|
Route::resource('airlines', 'AirlinesController');
|
2017-07-06 07:48:32 +08:00
|
|
|
|
|
|
|
Route::match(['get', 'put'], 'airports/fuel', 'AirportController@fuel');
|
|
|
|
Route::resource('airports', 'AirportController');
|
|
|
|
|
2017-06-11 09:27:24 +08:00
|
|
|
Route::resource('fares', 'FareController');
|
2017-06-21 22:22:59 +08:00
|
|
|
|
2017-06-23 09:55:45 +08:00
|
|
|
# subfleet
|
|
|
|
Route::resource('subfleets', 'SubfleetController');
|
2017-06-25 00:09:27 +08:00
|
|
|
Route::match(['get', 'post', 'put', 'delete'], 'subfleets/{id}/fares', 'SubfleetController@fares');
|
2018-02-21 11:53:50 +08:00
|
|
|
Route::match(['get', 'post', 'delete'], 'subfleets/{id}/ranks', 'SubfleetController@ranks');
|
2017-06-23 09:55:45 +08:00
|
|
|
|
2017-06-21 22:22:59 +08:00
|
|
|
# aircraft and fare associations
|
|
|
|
Route::resource('aircraft', 'AircraftController');
|
|
|
|
|
|
|
|
# flights and aircraft associations
|
|
|
|
Route::resource('flights', 'FlightController');
|
2018-01-08 00:38:16 +08:00
|
|
|
Route::match(['get', 'post', 'put', 'delete'], 'flights/{id}/fares', 'FlightController@fares');
|
2017-07-12 06:44:12 +08:00
|
|
|
Route::match(['get', 'post', 'put', 'delete'], 'flights/{id}/fields', 'FlightController@fields');
|
2017-06-24 06:33:18 +08:00
|
|
|
Route::match(['get', 'post', 'put', 'delete'], 'flights/{id}/subfleets', 'FlightController@subfleets');
|
2017-06-21 22:22:59 +08:00
|
|
|
|
2017-06-22 02:44:30 +08:00
|
|
|
# rankings
|
|
|
|
Route::resource('ranks', 'RankController');
|
2017-07-02 10:06:55 +08:00
|
|
|
Route::match(['get', 'post', 'put', 'delete'], 'ranks/{id}/subfleets', 'RankController@subfleets');
|
2017-06-22 02:44:30 +08:00
|
|
|
|
2017-06-21 22:22:59 +08:00
|
|
|
# view/update settings
|
|
|
|
Route::match(['get'], 'settings', 'SettingsController@index');
|
2017-12-31 00:38:18 +08:00
|
|
|
Route::match(['post', 'put'], 'settings', 'SettingsController@update')->name('settings.update');
|
2017-06-21 22:22:59 +08:00
|
|
|
|
2017-06-29 08:54:05 +08:00
|
|
|
# pirep related routes
|
2018-02-25 05:38:25 +08:00
|
|
|
Route::get('pireps/fares', 'PirepController@fares');
|
|
|
|
Route::get('pireps/pending', 'PirepController@pending');
|
2017-06-29 08:54:05 +08:00
|
|
|
Route::resource('pireps', 'PirepController');
|
2018-01-04 05:27:56 +08:00
|
|
|
Route::match(['get', 'post', 'delete'], 'pireps/{id}/comments', 'PirepController@comments');
|
2018-01-02 06:26:02 +08:00
|
|
|
Route::match(['post', 'put'], 'pireps/{id}/status', 'PirepController@status')->name('pirep.status');
|
2017-12-03 14:48:33 +08:00
|
|
|
|
2017-06-29 08:54:05 +08:00
|
|
|
Route::resource('pirepfields', 'PirepFieldController');
|
|
|
|
|
2017-11-30 08:01:07 +08:00
|
|
|
Route::resource('users', 'UserController');
|
2018-01-08 05:09:22 +08:00
|
|
|
Route::get('users/{id}/regen_apikey',
|
|
|
|
'UserController@regen_apikey')->name('users.regen_apikey');
|
2017-11-30 08:01:07 +08:00
|
|
|
|
2017-06-21 22:22:59 +08:00
|
|
|
# defaults
|
|
|
|
Route::get('', ['uses' => 'DashboardController@index']);
|
|
|
|
Route::get('/', ['uses' => 'DashboardController@index']);
|
2018-01-09 06:22:26 +08:00
|
|
|
|
|
|
|
Route::get('dashboard', ['uses' => 'DashboardController@index', 'name' => 'dashboard']);
|
|
|
|
Route::match(['get', 'post', 'delete'],
|
|
|
|
'dashboard/news', ['uses' => 'DashboardController@news'])
|
|
|
|
->name('dashboard.news');
|
2017-06-21 22:22:59 +08:00
|
|
|
});
|