public function delete($idtraining) { $training = Training::findOrFail($idtraining); return view('pages/training/delete', compact('training')); }
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); }