2017-06-09 02:28:26 +08:00
|
|
|
<?php
|
|
|
|
|
2017-12-28 06:47:22 +08:00
|
|
|
/**
|
2018-02-10 03:20:35 +08:00
|
|
|
* Public routes
|
2017-12-28 06:47:22 +08:00
|
|
|
*/
|
2018-03-20 09:50:40 +08:00
|
|
|
Route::group([], function () {
|
2017-12-29 04:35:28 +08:00
|
|
|
Route::get('acars', 'AcarsController@index');
|
2018-05-04 04:07:16 +08:00
|
|
|
Route::get('pireps', 'PirepController@index');
|
2018-05-03 04:14:18 +08:00
|
|
|
Route::get('pireps/{pirep_id}', 'PirepController@get');
|
2018-05-10 01:45:24 +08:00
|
|
|
Route::get('pireps/{pirep_id}/acars/geojson', 'AcarsController@acars_geojson');
|
2018-02-10 03:20:35 +08:00
|
|
|
|
2018-04-12 09:01:41 +08:00
|
|
|
Route::get('news', 'NewsController@index');
|
2018-02-10 03:20:35 +08:00
|
|
|
Route::get('status', 'StatusController@status');
|
|
|
|
Route::get('version', 'StatusController@status');
|
|
|
|
});
|
2017-12-28 06:47:22 +08:00
|
|
|
|
2018-02-10 03:20:35 +08:00
|
|
|
/**
|
|
|
|
* these need to be authenticated with a user's API key
|
|
|
|
*/
|
2018-03-20 09:50:40 +08:00
|
|
|
Route::group(['middleware' => ['api.auth']], function () {
|
2018-01-07 05:13:33 +08:00
|
|
|
Route::get('airlines', 'AirlineController@index');
|
|
|
|
Route::get('airlines/{id}', 'AirlineController@get');
|
|
|
|
|
2018-01-06 00:23:26 +08:00
|
|
|
Route::get('airports', 'AirportController@index');
|
2018-01-06 05:30:35 +08:00
|
|
|
Route::get('airports/hubs', 'AirportController@index_hubs');
|
2018-01-03 00:53:25 +08:00
|
|
|
Route::get('airports/{id}', 'AirportController@get');
|
|
|
|
Route::get('airports/{id}/lookup', 'AirportController@lookup');
|
|
|
|
|
2018-01-06 00:45:34 +08:00
|
|
|
Route::get('fleet', 'FleetController@index');
|
2018-01-06 03:00:45 +08:00
|
|
|
Route::get('fleet/aircraft/{id}', 'FleetController@get_aircraft');
|
2018-01-06 00:45:34 +08:00
|
|
|
|
2018-01-07 05:21:21 +08:00
|
|
|
Route::get('flights', 'FlightController@index');
|
2017-12-29 04:35:28 +08:00
|
|
|
Route::get('flights/search', 'FlightController@search');
|
|
|
|
Route::get('flights/{id}', 'FlightController@get');
|
2018-02-21 02:06:52 +08:00
|
|
|
Route::get('flights/{id}/route', 'FlightController@route');
|
2017-12-28 06:47:22 +08:00
|
|
|
|
2018-02-10 03:20:35 +08:00
|
|
|
Route::put('pireps/{pirep_id}', 'PirepController@update');
|
2017-08-15 12:36:49 +08:00
|
|
|
|
2018-02-10 03:20:35 +08:00
|
|
|
/*
|
|
|
|
* ACARS related
|
|
|
|
*/
|
2017-12-29 04:35:28 +08:00
|
|
|
Route::post('pireps/prefile', 'PirepController@prefile');
|
2018-01-31 01:36:22 +08:00
|
|
|
Route::post('pireps/{pirep_id}/update', 'PirepController@update');
|
2018-01-29 01:12:13 +08:00
|
|
|
Route::post('pireps/{pirep_id}/file', 'PirepController@file');
|
2018-01-31 01:36:22 +08:00
|
|
|
Route::post('pireps/{pirep_id}/comments', 'PirepController@comments_post');
|
2018-01-29 01:12:13 +08:00
|
|
|
Route::delete('pireps/{pirep_id}/cancel', 'PirepController@cancel');
|
2018-01-05 09:33:23 +08:00
|
|
|
|
2018-05-10 01:45:24 +08:00
|
|
|
Route::get('pireps/{pirep_id}/fields', 'PirepController@fields_get');
|
|
|
|
Route::post('pireps/{pirep_id}/fields', 'PirepController@fields_post');
|
|
|
|
|
|
|
|
|
2018-03-06 03:07:10 +08:00
|
|
|
Route::get('pireps/{pirep_id}/finances', 'PirepController@finances_get');
|
|
|
|
Route::post('pireps/{pirep_id}/finances/recalculate', 'PirepController@finances_recalculate');
|
|
|
|
|
2018-02-10 03:20:35 +08:00
|
|
|
Route::get('pireps/{pirep_id}/route', 'PirepController@route_get');
|
2018-01-31 01:36:22 +08:00
|
|
|
Route::post('pireps/{pirep_id}/route', 'PirepController@route_post');
|
|
|
|
Route::delete('pireps/{pirep_id}/route', 'PirepController@route_delete');
|
|
|
|
|
2018-02-10 03:20:35 +08:00
|
|
|
Route::get('pireps/{pirep_id}/comments', 'PirepController@comments_get');
|
|
|
|
|
2018-05-10 01:45:24 +08:00
|
|
|
Route::get('pireps/{pirep_id}/acars/position', 'AcarsController@acars_get');
|
|
|
|
Route::post('pireps/{pirep_id}/acars/position', 'AcarsController@acars_store');
|
|
|
|
Route::post('pireps/{pirep_id}/acars/positions', 'AcarsController@acars_store');
|
2018-01-05 10:08:22 +08:00
|
|
|
|
2018-05-10 01:45:24 +08:00
|
|
|
Route::post('pireps/{pirep_id}/acars/events', 'AcarsController@acars_events');
|
|
|
|
Route::post('pireps/{pirep_id}/acars/logs', 'AcarsController@acars_logs');
|
2017-12-26 05:19:34 +08:00
|
|
|
|
2018-01-07 05:41:23 +08:00
|
|
|
Route::get('settings', 'SettingsController@index');
|
|
|
|
|
2017-12-13 06:58:27 +08:00
|
|
|
# This is the info of the user whose token is in use
|
2017-12-29 04:35:28 +08:00
|
|
|
Route::get('user', 'UserController@index');
|
2018-01-11 08:40:01 +08:00
|
|
|
Route::get('user/fleet', 'UserController@fleet');
|
2018-02-20 00:35:49 +08:00
|
|
|
Route::get('user/pireps', 'UserController@pireps');
|
2018-01-07 05:41:23 +08:00
|
|
|
|
2018-02-23 00:44:15 +08:00
|
|
|
Route::get('user/bids', 'UserController@bids');
|
|
|
|
Route::put('user/bids', 'UserController@bids');
|
2018-03-13 14:26:27 +08:00
|
|
|
Route::post('user/bids', 'UserController@bids');
|
2018-02-23 00:44:15 +08:00
|
|
|
Route::delete('user/bids', 'UserController@bids');
|
|
|
|
|
2017-12-29 04:35:28 +08:00
|
|
|
Route::get('users/{id}', 'UserController@get');
|
2018-01-11 08:40:01 +08:00
|
|
|
Route::get('users/{id}/fleet', 'UserController@fleet');
|
2018-02-20 00:35:49 +08:00
|
|
|
Route::get('users/{id}/pireps', 'UserController@pireps');
|
2018-02-10 03:20:35 +08:00
|
|
|
|
2018-02-23 00:44:15 +08:00
|
|
|
Route::get('users/{id}/bids', 'UserController@bids');
|
|
|
|
Route::put('users/{id}/bids', 'UserController@bids');
|
2017-08-15 07:26:20 +08:00
|
|
|
});
|