public function index() { $ministry = Ministry::whereSlug('missions')->first(); $staff = $ministry->staff; $locations = MissionLocation::upcoming()->get(); $missionaries = Missionary::with('missionlocation')->get(); return view('missions', ['ministry' => $ministry, 'missionaries' => $missionaries, 'staff' => $staff, 'locations' => $locations]); }
private function importMissionaries() { $table = 'missionaries'; Missionary::unguard(); DB::table($table)->truncate(); $missionary = new Missionary(['slug' => 'beukemas', 'name' => 'The Beukemas', 'mission_location_id' => MissionLocation::where('slug', '=', 'jamaica')->first()->id, 'url' => 'http://bkbeukema.org']); $missionary->save(); $missionary = new Missionary(['slug' => 'coplands', 'name' => 'The Coplands', 'mission_location_id' => MissionLocation::where('slug', '=', 'italy')->first()->id, 'url' => 'http://nickandshannan.org']); $missionary->save(); $missionary = new Missionary(['slug' => 'chris-ladd', 'name' => 'Chris Ladd', 'mission_location_id' => MissionLocation::where('slug', '=', 'south-africa')->first()->id, 'url' => 'http://chrisleeladd.com']); $missionary->save(); $missionary = new Missionary(['slug' => 'julie-rumph', 'name' => 'Julie Rumph', 'mission_location_id' => MissionLocation::where('slug', '=', 'south-africa')->first()->id, 'url' => 'http://julierumph.com']); $missionary->save(); }