/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create($slug = Null) { $stations = Station::user()->with('Airport')->get(); $aircraft_usages = AircraftUsage::user()->with('Aircraft')->get(); $departure_offset = ['+1' => '+1', '+2' => '+2', '0' => '0', '-1' => '-1', '-2' => '-2']; //get list for Dropdown foreach ($aircraft_usages as $aircraft_usage) { $aircrafts[$aircraft_usage->id] = $aircraft_usage->aircraft->type; } //get list for Dropdown foreach ($stations as $station) { $airports[$station->id] = $station->airport->name; } return view('template.flightThread.create', ['stations' => $airports, 'aircrafts' => $aircrafts, 'departure_offset' => $departure_offset]); }