v1.1.0 - Washing machines and locations is on the same pages now, made bruger roles immortal so you cant delete it or edit it
This commit is contained in:
@@ -64,11 +64,11 @@ class LocationController extends Controller
|
||||
|
||||
// If there already is a washing machine with that name, then don't add it
|
||||
if (count($locations) > 0)
|
||||
return redirect()->route("locations.index");
|
||||
return redirect()->route("washing-machines.index");
|
||||
else { // Else - Add it
|
||||
$location->save();
|
||||
$locations = Location::query()->paginate(20);
|
||||
return redirect()->route("locations.index", ['locations' => $locations]);
|
||||
return redirect()->route("washing-machines.index", ['locations' => $locations]);//washing-machines.index kan byttes ud med locations.index
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,13 +114,13 @@ class LocationController extends Controller
|
||||
|
||||
// If there already is a washing machine with that name, then don't change it
|
||||
if (count($allMachines) > 0)
|
||||
return redirect()->route("locations.index");
|
||||
return redirect()->route("washing-machines.index");
|
||||
else { // Else - Change the name
|
||||
$location->update($data);
|
||||
$location->save();
|
||||
|
||||
$locations = Location::query()->paginate(20);
|
||||
return redirect()->route("locations.index", ["locations" => $locations]);
|
||||
return redirect()->route("washing-machines.index", ["locations" => $locations]); //washing-machines.index kan byttes ud med locations.index
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ class LocationController extends Controller
|
||||
|
||||
$location->delete();
|
||||
|
||||
return redirect()->route("locations.index");
|
||||
return redirect()->route("washing-machines.index");//washing-machines.index kan byttes ud med locations.index
|
||||
}
|
||||
|
||||
public function nameCheck(Request $request){
|
||||
|
||||
Reference in New Issue
Block a user