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([
|
2018-03-20 09:50:40 +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
|
|
|
|
2018-03-23 02:04:13 +08:00
|
|
|
Route::get('airports/export', 'AirportController@export')->name('airports.export');
|
2018-03-13 14:48:47 +08:00
|
|
|
Route::match(['get', 'post', 'put'], 'airports/fuel', 'AirportController@fuel');
|
2018-03-21 08:17:11 +08:00
|
|
|
Route::match(['get', 'post'], 'airports/import', 'AirportController@import')->name('airports.import');
|
2018-03-06 12:10:00 +08:00
|
|
|
Route::match(['get', 'post', 'put', 'delete'], 'airports/{id}/expenses', 'AirportController@expenses');
|
2018-03-21 08:17:11 +08:00
|
|
|
Route::resource('airports', 'AirportController');
|
2017-07-06 07:48:32 +08:00
|
|
|
|
2018-03-17 13:03:17 +08:00
|
|
|
# Awards
|
2018-01-29 03:19:35 +08:00
|
|
|
Route::resource('awards', 'AwardController');
|
|
|
|
|
2017-06-21 22:22:59 +08:00
|
|
|
# aircraft and fare associations
|
2018-03-23 01:55:56 +08:00
|
|
|
Route::get('aircraft/export', 'AircraftController@export')->name('aircraft.export');
|
2018-03-21 08:17:11 +08:00
|
|
|
Route::match(['get', 'post'], 'aircraft/import', 'AircraftController@import')->name('aircraft.import');
|
2018-03-07 07:32:56 +08:00
|
|
|
Route::match(['get', 'post', 'put', 'delete'], 'aircraft/{id}/expenses', 'AircraftController@expenses');
|
2018-03-21 08:17:11 +08:00
|
|
|
Route::resource('aircraft', 'AircraftController');
|
2017-06-21 22:22:59 +08:00
|
|
|
|
2018-02-27 05:16:12 +08:00
|
|
|
# expenses
|
2018-03-23 06:17:37 +08:00
|
|
|
Route::get('expenses/export', 'ExpenseController@export')->name('expenses.export');
|
|
|
|
Route::match(['get', 'post'], 'expenses/import', 'ExpenseController@import')->name('expenses.import');
|
2018-02-27 05:16:12 +08:00
|
|
|
Route::resource('expenses', 'ExpenseController');
|
|
|
|
|
|
|
|
# fares
|
2018-03-23 06:48:57 +08:00
|
|
|
Route::get('fares/export', 'FareController@export')->name('fares.export');
|
|
|
|
Route::match(['get', 'post'], 'fares/import', 'FareController@import')->name('fares.import');
|
2018-02-27 05:16:12 +08:00
|
|
|
Route::resource('fares', 'FareController');
|
|
|
|
|
2018-04-02 07:02:12 +08:00
|
|
|
# files
|
|
|
|
Route::post('files', 'FilesController@store')->name('files.store');
|
|
|
|
Route::delete('files/{id}/delete', 'FilesController@delete')->name('files.delete');
|
|
|
|
|
2018-03-06 04:18:54 +08:00
|
|
|
# finances
|
|
|
|
Route::resource('finances', 'FinanceController');
|
|
|
|
|
2017-06-21 22:22:59 +08:00
|
|
|
# flights and aircraft associations
|
2018-03-22 06:07:30 +08:00
|
|
|
Route::get('flights/export', 'FlightController@export')->name('flights.export');
|
2018-03-21 08:17:11 +08:00
|
|
|
Route::match(['get', 'post'], 'flights/import', 'FlightController@import')->name('flights.import');
|
2018-01-08 00:38:16 +08:00
|
|
|
Route::match(['get', 'post', 'put', 'delete'], 'flights/{id}/fares', 'FlightController@fares');
|
2018-03-21 02:06:06 +08:00
|
|
|
Route::match(['get', 'post', 'put', 'delete'], 'flights/{id}/fields', 'FlightController@field_values');
|
2017-06-24 06:33:18 +08:00
|
|
|
Route::match(['get', 'post', 'put', 'delete'], 'flights/{id}/subfleets', 'FlightController@subfleets');
|
2018-03-21 08:17:11 +08:00
|
|
|
Route::resource('flights', 'FlightController');
|
2017-06-21 22:22:59 +08:00
|
|
|
|
2018-03-21 02:47:47 +08:00
|
|
|
Route::resource('flightfields', 'FlightFieldController');
|
|
|
|
|
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');
|
|
|
|
|
2018-02-27 05:16:12 +08:00
|
|
|
# rankings
|
|
|
|
Route::resource('ranks', 'RankController');
|
|
|
|
Route::match(['get', 'post', 'put', 'delete'], 'ranks/{id}/subfleets', 'RankController@subfleets');
|
|
|
|
|
|
|
|
# settings
|
|
|
|
Route::match(['get'], 'settings', 'SettingsController@index');
|
|
|
|
Route::match(['post', 'put'], 'settings', 'SettingsController@update')->name('settings.update');
|
|
|
|
|
|
|
|
# subfleet
|
2018-03-23 06:59:10 +08:00
|
|
|
Route::get('subfleets/export', 'SubfleetController@export')->name('subfleets.export');
|
2018-03-21 08:17:11 +08:00
|
|
|
Route::match(['get', 'post'], 'subfleets/import', 'SubfleetController@import')->name('subfleets.import');
|
2018-03-06 02:21:38 +08:00
|
|
|
Route::match(['get', 'post', 'put', 'delete'], 'subfleets/{id}/expenses', 'SubfleetController@expenses');
|
2018-02-27 05:16:12 +08:00
|
|
|
Route::match(['get', 'post', 'put', 'delete'], 'subfleets/{id}/fares', 'SubfleetController@fares');
|
2018-02-27 09:14:10 +08:00
|
|
|
Route::match(['get', 'post', 'put', 'delete'], 'subfleets/{id}/ranks', 'SubfleetController@ranks');
|
2018-03-21 08:17:11 +08:00
|
|
|
Route::resource('subfleets', 'SubfleetController');
|
2018-02-27 05:16:12 +08:00
|
|
|
|
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',
|
2018-03-20 09:50:40 +08:00
|
|
|
'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'],
|
2018-03-20 09:50:40 +08:00
|
|
|
'dashboard/news', ['uses' => 'DashboardController@news'])
|
2018-01-09 06:22:26 +08:00
|
|
|
->name('dashboard.news');
|
2017-06-21 22:22:59 +08:00
|
|
|
});
|