Reorganized folders to try to clean up the root folder a bit
This commit is contained in:
50
app/Routes/admin.php
Normal file
50
app/Routes/admin.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin Routes
|
||||
*/
|
||||
|
||||
Route::group([
|
||||
'namespace' => 'Admin', 'prefix' => 'admin', 'as' => 'admin.',
|
||||
'middleware' => ['role:admin'],
|
||||
], function () {
|
||||
Route::resource('airlines', 'AirlinesController');
|
||||
|
||||
Route::match(['get', 'put'], 'airports/fuel', 'AirportController@fuel');
|
||||
Route::resource('airports', 'AirportController');
|
||||
|
||||
Route::resource('fares', 'FareController');
|
||||
|
||||
# subfleet
|
||||
Route::resource('subfleets', 'SubfleetController');
|
||||
Route::match(['get', 'post', 'put', 'delete'], 'subfleets/{id}/fares', 'SubfleetController@fares');
|
||||
|
||||
# aircraft and fare associations
|
||||
Route::resource('aircraft', 'AircraftController');
|
||||
|
||||
# flights and aircraft associations
|
||||
Route::resource('flights', 'FlightController');
|
||||
Route::match(['get', 'post', 'put', 'delete'], 'flights/{id}/fields', 'FlightController@fields');
|
||||
Route::match(['get', 'post', 'put', 'delete'], 'flights/{id}/subfleets', 'FlightController@subfleets');
|
||||
|
||||
# rankings
|
||||
Route::resource('ranks', 'RankController');
|
||||
Route::match(['get', 'post', 'put', 'delete'], 'ranks/{id}/subfleets', 'RankController@subfleets');
|
||||
|
||||
# view/update settings
|
||||
Route::match(['get'], 'settings', 'SettingsController@index');
|
||||
Route::match(['post', 'put'], 'settings', 'SettingsController@update');
|
||||
|
||||
# pirep related routes
|
||||
Route::resource('pireps', 'PirepController');
|
||||
Route::match(['get'], 'pireps/pending', 'PirepController@pending');
|
||||
Route::match(['post', 'put'], 'pireps/{id}/status', 'PirepController@status');
|
||||
|
||||
Route::resource('pirepfields', 'PirepFieldController');
|
||||
|
||||
Route::resource('users', 'UserController');
|
||||
|
||||
# defaults
|
||||
Route::get('', ['uses' => 'DashboardController@index']);
|
||||
Route::get('/', ['uses' => 'DashboardController@index']);
|
||||
Route::get('/dashboard', ['uses' => 'DashboardController@index', 'name' => 'dashboard']);
|
||||
});
|
||||
33
app/Routes/api.php
Executable file
33
app/Routes/api.php
Executable file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| API Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register API routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider within a group which
|
||||
| is assigned the "api" middleware group. Enjoy building your API!
|
||||
|
|
||||
*/
|
||||
|
||||
Route::group([], function ()
|
||||
{
|
||||
Route::match(['get'], 'status', 'BaseController@status');
|
||||
|
||||
Route::match(['get'], 'airports/{id}', 'AirportController@get');
|
||||
Route::match(['get'], 'airports/{id}/lookup', 'AirportController@lookup');
|
||||
|
||||
Route::match(['get'], 'flights/search', 'FlightController@search');
|
||||
Route::match(['get'], 'flights/{id}', 'FlightController@get');
|
||||
|
||||
Route::match(['get'], 'pirep/{id}', 'PirepController@get');
|
||||
|
||||
# This is the info of the user whose token is in use
|
||||
Route::match(['get'], 'user', 'UserController@index');
|
||||
#Route::match(['get'], 'user/bids', 'UserController@index');
|
||||
Route::match(['get'], 'users/{id}', 'UserController@get');
|
||||
Route::match(['get'], 'users/{id}/bids', 'UserController@bids');
|
||||
});
|
||||
18
app/Routes/console.php
Executable file
18
app/Routes/console.php
Executable file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Foundation\Inspiring;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Console Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This file is where you may define all of your Closure based console
|
||||
| commands. Each Closure is bound to a command instance allowing a
|
||||
| simple approach to interacting with each command's IO methods.
|
||||
|
|
||||
*/
|
||||
|
||||
Artisan::command('inspire', function () {
|
||||
$this->comment(Inspiring::quote());
|
||||
});
|
||||
35
app/Routes/web.php
Executable file
35
app/Routes/web.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
Route::get('/', 'HomeController@index')->name('home');
|
||||
|
||||
/**
|
||||
* User doesn't need to be logged in for these
|
||||
*/
|
||||
Route::group([
|
||||
'namespace' => 'Frontend', 'prefix' => '', 'as' => 'frontend.'
|
||||
], function() {
|
||||
Route::get('/r/{id}', 'PirepController@show')->name('pirep.show.public');
|
||||
Route::get('/p/{id}', 'ProfileController@show')->name('profile.show.public');
|
||||
});
|
||||
|
||||
/**
|
||||
* These are only visible to a logged in user
|
||||
*/
|
||||
Route::group([
|
||||
'namespace' => 'Frontend', 'prefix' => '', 'as' => 'frontend.',
|
||||
'middleware' => ['role:admin|user'],
|
||||
], function () {
|
||||
Route::resource('dashboard', 'DashboardController');
|
||||
|
||||
Route::get('flights/search', 'FlightController@search')->name('flights.search');
|
||||
Route::match(['post'], '/flights/save', 'FlightController@save')->name('flights.save');
|
||||
Route::resource('flights', 'FlightController');
|
||||
|
||||
Route::resource('profile', 'ProfileController');
|
||||
Route::resource('pireps', 'PirepController');
|
||||
});
|
||||
|
||||
Auth::routes();
|
||||
Route::get('/logout', 'Auth\LoginController@logout')->name('logout');
|
||||
|
||||
require app_path('Routes/admin.php');
|
||||
Reference in New Issue
Block a user