Exemplo n.º 1
0
 /**
  * Delete the specified resource in storage.
  *
  * @return \Illuminate\Http\Response
  */
 public function destroy(Request $request, $id)
 {
     // Check authorisation and throw 404 if not
     if (!(Auth::user()->company->subscription && Auth::user()->is('full.access|full.read.acccess|whs.admin'))) {
         return view('errors/404');
     }
     $tip = SafetyTip::findOrFail($id);
     $tip->delete();
     return json_encode('success');
 }