2017-12-12 21:25:11 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
|
|
|
|
use Illuminate\Http\Resources\Json\Resource;
|
|
|
|
|
|
|
|
class Flight extends Resource
|
|
|
|
{
|
|
|
|
public function toArray($request)
|
|
|
|
{
|
2018-02-05 02:39:51 +08:00
|
|
|
$flight = parent::toArray($request);
|
2017-12-13 06:58:27 +08:00
|
|
|
|
2018-02-05 02:39:51 +08:00
|
|
|
$flight['airline'] = new Airline($this->airline);
|
|
|
|
$flight['subfleet'] = Subfleet::collection($this->subfleets);
|
|
|
|
|
|
|
|
return $flight;
|
2017-12-12 21:25:11 +08:00
|
|
|
}
|
|
|
|
}
|