app/Http/Controllers/JobCategoryController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index(Request $request)
    {
        $jobCateId = $request->jobtype;
        if ($jobCateId!=null && !empty($jobCateId)) {
            $jobCates = JobCategory::where('job_type_id', $jobCateId)->paginate(10);
        } else {
            $jobCates = JobCategory::paginate(10);
        }
        if($request->isXmlHttpRequest()) {
            return response(
                view('layouts.admin.job_and_relate.job_category.table', ['jobCates' => $jobCates]),
                200,
                ['Content-Type', 'application/json']
            );
        }
        return view('layouts.admin.job_and_relate.job_category.index')->with('jobCates',$jobCates)->with('jobtype', $jobCateId);
    }
public function index ( Request $ request ) { $ jobCateId = $ request -> jobtype ; if ( $ jobCateId != null && ! empty ( $ jobCateId ) ) { $ jobCates = JobCategory :: where ( 'job_type_id' , $ jobCateId ) -> paginate ( 10 ) ; } else { $ jobCates = JobCategory :: paginate ( 10 ) ; } if ( $ request -> isXmlHttpRequest ( ) ) { return response ( view ( 'layouts.admin.job_and_relate.job_category.table' , [ 'jobCates' => $ jobCates ] ) , 200 , [ 'Content-Type' , 'application/json' ] ) ; } return view ( 'layouts.admin.job_and_relate.job_category.index' ) -> with ( 'jobCates' , $ jobCates ) -> with ( 'jobtype' , $ jobCateId ) ; }
Display a listing of the resource.
Display a listing of the resource .