コード例 #1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     try {
         $referral = Referral::findOrFail($id);
         $referral->delete();
     } catch (ModelNotFoundException $ex) {
         Flash::error('No referral found' . $ex);
         return redirect()->route('referrals.index');
     }
     Flash::success('Referral deleted successfully');
     return back();
 }