phpvms/app/Routes/admin.php

99 lines
4.5 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([
'namespace' => 'Admin', 'prefix' => 'admin', 'as' => 'admin.',
'middleware' => ['ability:admin,admin-access'],
], static function () {
// CRUD for airlines
2017-06-10 03:47:02 +08:00
Route::resource('airlines', 'AirlinesController');
2017-07-06 07:48:32 +08:00
// CRUD for roles
Route::resource('roles', 'RolesController');
2018-03-23 02:04:13 +08:00
Route::get('airports/export', 'AirportController@export')->name('airports.export');
Route::match(['get', 'post', 'put'], 'airports/fuel', 'AirportController@fuel');
Route::match(['get', 'post'], 'airports/import', 'AirportController@import')->name('airports.import');
Route::match(['get', 'post', 'put', 'delete'], 'airports/{id}/expenses', 'AirportController@expenses');
Route::resource('airports', 'AirportController');
2017-07-06 07:48:32 +08:00
2018-08-27 00:40:04 +08:00
// Awards
2018-01-29 03:19:35 +08:00
Route::resource('awards', 'AwardController');
2018-08-27 00:40:04 +08:00
// aircraft and fare associations
2018-03-23 01:55:56 +08:00
Route::get('aircraft/export', 'AircraftController@export')->name('aircraft.export');
Route::match(['get', 'post'], 'aircraft/import', 'AircraftController@import')->name('aircraft.import');
Route::match(['get', 'post', 'put', 'delete'], 'aircraft/{id}/expenses', 'AircraftController@expenses');
Route::resource('aircraft', 'AircraftController');
2017-06-21 22:22:59 +08:00
2018-08-27 00:40:04 +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');
Route::resource('expenses', 'ExpenseController');
2018-08-27 00:40:04 +08:00
// 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');
Route::resource('fares', 'FareController');
2018-08-27 00:40:04 +08:00
// files
2018-04-03 02:42:24 +08:00
Route::post('files', 'FileController@store')->name('files.store');
Route::delete('files/{id}', 'FileController@destroy')->name('files.delete');
2018-08-27 00:40:04 +08:00
// finances
Route::resource('finances', 'FinanceController');
2018-08-27 00:40:04 +08:00
// flights and aircraft associations
2018-03-22 06:07:30 +08:00
Route::get('flights/export', 'FlightController@export')->name('flights.export');
Route::match(['get', 'post'], 'flights/import', 'FlightController@import')->name('flights.import');
Route::match(['get', 'post', 'put', 'delete'], 'flights/{id}/fares', 'FlightController@fares');
Route::match(['get', 'post', 'put', 'delete'], 'flights/{id}/fields', 'FlightController@field_values');
Route::match(['get', 'post', 'put', 'delete'], 'flights/{id}/subfleets', 'FlightController@subfleets');
Route::resource('flights', 'FlightController');
2017-06-21 22:22:59 +08:00
Route::resource('flightfields', 'FlightFieldController');
2018-08-27 00:40:04 +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');
2018-08-27 00:40:04 +08:00
// rankings
Route::resource('ranks', 'RankController');
Route::match(['get', 'post', 'put', 'delete'], 'ranks/{id}/subfleets', 'RankController@subfleets');
2018-08-27 00:40:04 +08:00
// settings
Route::match(['get'], 'settings', 'SettingsController@index');
Route::match(['post', 'put'], 'settings', 'SettingsController@update')->name('settings.update');
2018-08-27 00:40:04 +08:00
// subfleet
2018-03-23 06:59:10 +08:00
Route::get('subfleets/export', 'SubfleetController@export')->name('subfleets.export');
Route::match(['get', 'post'], 'subfleets/import', 'SubfleetController@import')->name('subfleets.import');
Route::match(['get', 'post', 'put', 'delete'], 'subfleets/{id}/expenses', 'SubfleetController@expenses');
Route::match(['get', 'post', 'put', 'delete'], 'subfleets/{id}/fares', 'SubfleetController@fares');
Route::match(['get', 'post', 'put', 'delete'], 'subfleets/{id}/ranks', 'SubfleetController@ranks');
Route::resource('subfleets', 'SubfleetController');
2017-11-30 08:01:07 +08:00
Route::resource('users', 'UserController');
2019-05-13 02:26:44 +08:00
Route::get(
'users/{id}/regen_apikey',
'UserController@regen_apikey'
)->name('users.regen_apikey');
2017-11-30 08:01:07 +08:00
2018-08-27 00:40:04 +08:00
// defaults
2017-06-21 22:22:59 +08:00
Route::get('', ['uses' => 'DashboardController@index']);
Route::get('/', ['uses' => 'DashboardController@index']);
Route::get('dashboard', ['uses' => 'DashboardController@index', 'name' => 'dashboard']);
2019-05-13 02:26:44 +08:00
Route::match(
['get', 'post', 'delete'],
'dashboard/news',
['uses' => 'DashboardController@news']
)->name('dashboard.news');
2017-06-21 22:22:59 +08:00
});