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