$slider = Slider::latest()->first(); $website = Website::latest()->first(); $career = Career::latest()->first(); $p_categorys = Category::orderBy('id', 'DESC')->latest()->get(); return view('frontend.pages.career', compact('slider', 'website', 'career','p_categorys')); } public function job_details($code) { $job = Job::where('code', $code)->first(); // if($job->user_id == Auth::user()->id){ // return redirect()->back()->with('error','You can not work this job! Because this job posted by you!'); // } $check_work = JobWork::where('user_id', Auth::user()->id)->where('job_id', $job->id)->count(); if($check_work > 0){ return redirect()->back()->with('error','Already worked this job!'); } if(work_by_me($job->id) == 1){ return redirect()->back()->with('error','Allready you have done this work!'); } $check_work_done = JobWork::where('job_id', $job->id)->where('status', '!=', 2)->count(); if($check_work_done >= $job->worker_need){ return redirect()->back()->with('error','Work limit over. Please try another jobs!'); } $title = 'Job details';