validate([ 'location_name' => 'required|min:2' ]); Locations::create([ 'name' => $request->location_name ]); return redirect()->route('locations.index') ->with('success', 'Location Created Successfully.'); } public function destroy(Locations $location) { $items = Locations::find($location->id); $items->delete(); return redirect()->route('locations.index') ->with('success', 'Location was deleted Successfully.'); } }