This commit is contained in:
frederikpyt
2020-08-18 08:36:07 +02:00
@@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use App\Location;
use App\WashingMachine;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
@@ -130,6 +131,10 @@ class LocationController extends Controller
public function destroy($id)
{
$locations = Location::find($id);
$washingMachines = WashingMachine::query()->where('location_id', '=', $id);
$washingMachines->delete();
$locations->delete();
return redirect()->route("locations.index");