app/Http/Controllers/JobLevelController.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)
    {
        $jobType = $request->jobtype;
        if ($jobType!=null && !empty($jobType)) {
            $jobLevels = JobLevel::where('job_type_id', $jobType)->paginate(10);
        } else {
            $jobLevels = JobLevel::paginate(10);
        }
        if($request->isXmlHttpRequest()) {
            return response(
                view('layouts.admin.job_and_relate.job_level.table', ['jobLevels' => $jobLevels]),
                200,
                ['Content-Type', 'application/json']
            );
        }
        return view('layouts.admin.job_and_relate.job_level.index')->with('jobLevels',$jobLevels)->with('jobtype', $jobType);
    }
public function index ( Request $ request ) { $ jobType = $ request -> jobtype ; if ( $ jobType != null && ! empty ( $ jobType ) ) { $ jobLevels = JobLevel :: where ( 'job_type_id' , $ jobType ) -> paginate ( 10 ) ; } else { $ jobLevels = JobLevel :: paginate ( 10 ) ; } if ( $ request -> isXmlHttpRequest ( ) ) { return response ( view ( 'layouts.admin.job_and_relate.job_level.table' , [ 'jobLevels' => $ jobLevels ] ) , 200 , [ 'Content-Type' , 'application/json' ] ) ; } return view ( 'layouts.admin.job_and_relate.job_level.index' ) -> with ( 'jobLevels' , $ jobLevels ) -> with ( 'jobtype' , $ jobType ) ; }
Display a listing of the resource.
Display a listing of the resource .