/** * Display a listing of machines for a specific location * * @param string $id * @return \\Illuminate\Http\Response */ public function showLocation($id) { // Show a list of machines for location $id $location = Location::findOrFail($id); // application will return HTTP 404 if $id doesn't exist $machines = Machine::with('modality', 'manufacturer', 'location')->active()->location($id)->get(); return view('machine.list_location', ['location' => $location, 'machines' => $machines, 'n' => $machines->count()]); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // Show a list of the locations $locations = Location::get(); return view('admin.location_index', ['locations' => $locations]); }