app/Http/Controllers/ReminderController.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()
    {
        $data['active_class'] = 'reminders';
        $data['clients'] = User::userRole('client')->get();
        $user = Auth::user();
        if($user->user_role == 'rm') {
            $client_ids = RmClient::getAssignedClients($user->id)->pluck('client_id');
        } elseif(Auth::user()->user_role == 'counselor') {
            $client_ids = CounsellorClient::getAssignedClients($user->id)->pluck('client_id');
        }
        $data['reminders'] = Reminder::whereIn('client_id', $client_ids)->get();
        return view('reminders.index', $data);
    }
public function index ( ) { $ data [ 'active_class' ] = 'reminders' ; $ data [ 'clients' ] = User :: userRole ( 'client' ) -> get ( ) ; $ user = Auth :: user ( ) ; if ( $ user -> user_role == 'rm' ) { $ client_ids = RmClient :: getAssignedClients ( $ user -> id ) -> pluck ( 'client_id' ) ; } elseif ( Auth :: user ( ) -> user_role == 'counselor' ) { $ client_ids = CounsellorClient :: getAssignedClients ( $ user -> id ) -> pluck ( 'client_id' ) ; } $ data [ 'reminders' ] = Reminder :: whereIn ( 'client_id' , $ client_ids ) -> get ( ) ; return view ( 'reminders.index' , $ data ) ; }
Display a listing of the resource.
Display a listing of the resource .