phpvms/app/Routes/api.php

86 lines
3.5 KiB
PHP
Raw Normal View History

2017-06-09 02:28:26 +08:00
<?php
/**
* Public routes
*/
Route::group([], function () {
2017-12-29 04:35:28 +08:00
Route::get('acars', 'AcarsController@index');
Route::get('pireps', 'PirepController@index');
2018-05-03 04:14:18 +08:00
Route::get('pireps/{pirep_id}', 'PirepController@get');
Route::get('pireps/{pirep_id}/acars/geojson', 'AcarsController@acars_geojson');
2018-04-12 09:01:41 +08:00
Route::get('news', 'NewsController@index');
Route::get('status', 'StatusController@status');
Route::get('version', 'StatusController@status');
});
2018-08-27 00:40:04 +08:00
/*
* these need to be authenticated with a user's API key
*/
Route::group(['middleware' => ['api.auth']], function () {
Route::get('airlines', 'AirlineController@index');
Route::get('airlines/{id}', 'AirlineController@get');
Route::get('airports', 'AirportController@index');
2018-01-06 05:30:35 +08:00
Route::get('airports/hubs', 'AirportController@index_hubs');
Route::get('airports/{id}', 'AirportController@get');
Route::get('airports/{id}/lookup', 'AirportController@lookup');
Route::get('fleet', 'FleetController@index');
Route::get('fleet/aircraft/{id}', 'FleetController@get_aircraft');
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');
Route::get('flights/{id}/route', 'FlightController@route');
Route::put('pireps/{pirep_id}', 'PirepController@update');
2017-08-15 12:36:49 +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');
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');
Route::delete('pireps/{pirep_id}/cancel', 'PirepController@cancel');
2018-01-05 09:33:23 +08:00
Route::get('pireps/{pirep_id}/fields', 'PirepController@fields_get');
Route::post('pireps/{pirep_id}/fields', 'PirepController@fields_post');
Route::get('pireps/{pirep_id}/finances', 'PirepController@finances_get');
Route::post('pireps/{pirep_id}/finances/recalculate', 'PirepController@finances_recalculate');
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');
Route::get('pireps/{pirep_id}/comments', 'PirepController@comments_get');
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');
Route::post('pireps/{pirep_id}/acars/events', 'AcarsController@acars_events');
Route::post('pireps/{pirep_id}/acars/logs', 'AcarsController@acars_logs');
Route::get('settings', 'SettingsController@index');
2018-08-27 00:40:04 +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');
Route::get('user/fleet', 'UserController@fleet');
2018-02-20 00:35:49 +08:00
Route::get('user/pireps', 'UserController@pireps');
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');
Route::delete('user/bids', 'UserController@bids');
2017-12-29 04:35:28 +08:00
Route::get('users/{id}', 'UserController@get');
Route::get('users/{id}/fleet', 'UserController@fleet');
2018-02-20 00:35:49 +08:00
Route::get('users/{id}/pireps', 'UserController@pireps');
Route::get('users/{id}/bids', 'UserController@bids');
Route::put('users/{id}/bids', 'UserController@bids');
2017-08-15 07:26:20 +08:00
});