$trip->id, 'name' => $trip->name, 'updated_at' => $trip->updated_at, 'flights' => $trip->flights()->get(), 'links' => [ 'rel' => 'self', 'uri' => '/trips/'.$trip->code, ] ]; } /** * Include Author * * @return \League\Fractal\Resource\ResourceAbstract */ public function includeFlights(Trips $trip) { $flights = $trip->flights()->get(); return $this->collection($flights, new FlightTransform()); } }