apl-mhd

laravel delete

Nov 7th, 2018
179
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  <form action="{{route('category.delete',$category->id)}}" method="post">
  2.          @csrf
  3.       @method('DELETE')
  4.    <button class="btn btn-lg btn-danger btn-block" type="submit">Delete Category</button>
  5. </form>
  6.  
  7.  
  8.  public  function  deleteAmbulanceInfo($id){
  9.          $ambulance = AmbulanceInfo::find($id);
  10.          $ambulance->delete();
  11.         session()->flash('message',   ' Successfully  Deleted');
  12.         return redirect()->back();
  13.      }
RAW Paste Data