public function delprepare($id) { if (Auth::guest()) { \Session::flash('msg', ' No Permission for that Request'); return redirect('job'); } $trg = Preparation::findOrFail($id); if (Auth::id() != $trg['Employer_id']) { \Session::flash('msg', ' No Permission for that Request'); return redirect('job'); } if (Preparation::find($id)->delete()) { \Session::flash('msg', 'You Have Successfully Deleted Preparation Material : ' . $trg->title); return redirect('job/preparation'); } }
public function preparation() { $pre = Preparation::latest('created_at')->where('created_at', '<=', Carbon::now())->get(); return view('job.preparation', compact('pre')); }