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-11 07:34:46 +08:00
|
|
|
$flight['field'] = true;
|
2018-02-05 02:39:51 +08:00
|
|
|
$flight['airline'] = new Airline($this->airline);
|
2018-02-10 04:26:14 +08:00
|
|
|
$flight['subfleets'] = Subfleet::collection($this->subfleets);
|
2018-02-05 02:39:51 +08:00
|
|
|
|
|
|
|
return $flight;
|
2017-12-12 21:25:11 +08:00
|
|
|
}
|
|
|
|
}
|