#35 rest api additions for pireps

This commit is contained in:
Nabeel Shahzad
2017-08-14 23:36:49 -05:00
parent 6a584b4d36
commit c45d0541ef
8 changed files with 122 additions and 22 deletions

View File

@@ -7,7 +7,6 @@ use Illuminate\Http\Request;
use App\Models\Airline;
use App\Models\Airport;
use App\Models\Flight;
use App\Models\Transformers\FlightTransformer;
use App\Http\Controllers\AppBaseController;
@@ -15,6 +14,13 @@ use App\Http\Controllers\AppBaseController;
class FlightController extends AppBaseController
{
public function get($id)
{
$flight = Flight::find($id);
return fractal($flight, new FlightTransformer())->respond();
}
public function search(Request $request)
{
$where = [];

View File

@@ -0,0 +1,17 @@
<?php
namespace App\Http\Controllers\Api;
use App\Models\Pirep;
use App\Models\Transformers\PirepTransformer;
use App\Http\Controllers\AppBaseController;
class PirepController extends AppBaseController
{
public function get($id)
{
$pirep = Pirep::find($id);
return fractal($pirep, new PirepTransformer())->respond();
}
}