/**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     if (Activity::destroy($id)) {
         return "Activity deleted successfully.";
     } else {
         return $this->response->error('Activity does not exist.', 404);
     }
 }
示例#2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     if (Gate::denies('destroy', Activity::class)) {
         abort(403);
     }
     $record = Activity::find($id);
     Activity::destroy($id);
     return redirect('/activity')->with('alert-info', 'The record has been deleted!');
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Activity::destroy($id);
     Session::flash('flash_message', 'Activity successfully deleted!');
     return redirect('activity');
 }
示例#4
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     //
     if (Auth::check()) {
         # code...
         if (Auth::user()->type == 1) {
             # code...
             //$activity = Activity::findOrFail($id);
             $activity = Activity::destroy($id);
             Session::flash('deleteActivity', 'The activity has been deleted!');
             return redirect('activity');
         }
         return redirect('/');
     }
     return redirect('/');
 }
 public function destroy($id)
 {
     Activity::destroy($id);
     return redirect('admin/activities');
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy(Request $request, $id)
 {
     Activity::destroy($id);
     return redirect($request->input('redirect_to'));
 }