app/Http/Controllers/ClientController.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()
    {
        $statusCodes = DB::table('statusCodes')
                    ->Where('code', '=', 136)
                    ->orWhere('code', '=', 137)
                    ->get();
        $clients = DB::table('clients')
                    ->join('statusCodes', 'statusCodes.code', '=', 'clients.status')
                    ->select('clients.*', 'statusCodes.description')
                    ->Paginate(7);
        return view('clients.index', compact('clients','statusCodes'));
    }
public function index ( ) { $ statusCodes = DB :: table ( 'statusCodes' ) -> Where ( 'code' , '=' , 136 ) -> orWhere ( 'code' , '=' , 137 ) -> get ( ) ; $ clients = DB :: table ( 'clients' ) -> join ( 'statusCodes' , 'statusCodes.code' , '=' , 'clients.status' ) -> select ( 'clients.*' , 'statusCodes.description' ) -> Paginate ( 7 ) ; return view ( 'clients.index' , compact ( 'clients' , 'statusCodes' ) ) ; }
Display a listing of the resource.
Display a listing of the resource .
//$statusCodes = DB::table('statusCodes')->get(); // $clients = DB::table('clients')->get(); // get all clients from db with pagination //return view('clients.index', ['statusCodes' => $statusCodes]);