app/Http/Controllers/NotificationTemplatesController.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')->get();
        $channelRefs = DB::table('client_channels_reference')->get();
        $notificationTemplates = DB::table('message_templates')
                ->join('client_channels_reference', 'client_channels_reference.channel_ref_id', '=', 'message_templates.channel_ref_id')
                ->join('statusCodes', 'statusCodes.code', '=', 'message_templates.status_code_id')
                ->select('message_templates.*', 'client_channels_reference.code', 'statusCodes.description')
                ->Paginate(6);
        return view('notifications_templates.index', compact('notificationTemplates','channelRefs','statusCodes'));
    }
public function index ( ) { $ statusCodes = DB :: table ( 'statusCodes' ) -> get ( ) ; $ channelRefs = DB :: table ( 'client_channels_reference' ) -> get ( ) ; $ notificationTemplates = DB :: table ( 'message_templates' ) -> join ( 'client_channels_reference' , 'client_channels_reference.channel_ref_id' , '=' , 'message_templates.channel_ref_id' ) -> join ( 'statusCodes' , 'statusCodes.code' , '=' , 'message_templates.status_code_id' ) -> select ( 'message_templates.*' , 'client_channels_reference.code' , 'statusCodes.description' ) -> Paginate ( 6 ) ; return view ( 'notifications_templates.index' , compact ( 'notificationTemplates' , 'channelRefs' , 'statusCodes' ) ) ; }
Display a listing of the resource.
Display a listing of the resource .
//$statusCodes = DB::table('statusCodes')->get(); // get all clients from db // get all message templates from db