phpvms/app/Routes/admin.php

65 lines
2.6 KiB
PHP
Raw Normal View History

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-21 22:22:59 +08:00
# aircraft and fare associations
Route::resource('aircraft', 'AircraftController');
# expenses
Route::resource('expenses', 'ExpenseController');
# fares
Route::resource('fares', 'FareController');
2017-06-21 22:22:59 +08:00
# flights and aircraft associations
Route::resource('flights', 'FlightController');
Route::match(['get', 'post', 'put', 'delete'], 'flights/{id}/fares', 'FlightController@fares');
Route::match(['get', 'post', 'put', 'delete'], 'flights/{id}/fields', 'FlightController@fields');
Route::match(['get', 'post', 'put', 'delete'], 'flights/{id}/subfleets', 'FlightController@subfleets');
2017-06-21 22:22:59 +08:00
2017-06-29 08:54:05 +08:00
# pirep related routes
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-06-29 08:54:05 +08:00
Route::resource('pirepfields', 'PirepFieldController');
# 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
Route::resource('subfleets', 'SubfleetController');
Route::match(['get', 'post', 'put', 'delete'], 'subfleets/{id}/fares', 'SubfleetController@fares');
Route::match(['get', 'post', 'delete'], 'subfleets/{id}/ranks', 'SubfleetController@ranks');
2017-11-30 08:01:07 +08:00
Route::resource('users', 'UserController');
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']);
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
});