Пример #1
0
 public function delete($idtraining)
 {
     $training = Training::findOrFail($idtraining);
     return view('pages/training/delete', compact('training'));
 }
Пример #2
0
 public function deltr($id)
 {
     if (Auth::guest()) {
         \Session::flash('msg', ' No Permission for that Request');
         return redirect('job');
     }
     $trg = Training::findOrFail($id);
     if (Auth::id() != $trg['Employer_id']) {
         \Session::flash('msg', ' No Permission for that Request');
         return redirect('job');
     }
     if (Training::find($id)->delete()) {
         \Session::flash('msg', 'You Have Successfully Deleted Training : ' . $trg->title);
         return redirect('job/training');
     }
 }
 public function findOrFail($id)
 {
     return Training::findOrFail($id);
 }