public function getOrCreateByName($name) { $spot = Spot::where('name', $name)->first(); if (!$spot) { $spot = new Spot(); $spot->name = $name; $spot->save(); } return $spot; }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { // $spotId = Request::get('id'); //echo $spotId; exit(); Spot::where('id', $spotId)->delete(); return redirect("spots"); }