app/Http/Controllers/FileController.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'] = 'file';
        $client_id = Auth::user()->id;
        $data['completed_tasks'] = ClientTask::getTasks($client_id, 'complete');
        $programs = $data['client_programs'] = ClientProgram::programs($client_id);
        $completion_array = [];
        foreach ($programs as $key => $program) {
            foreach ($program->programInfo as $pi) {
                $completion_array[$pi->program_name] = $this->programProgress($client_id, $pi->id);
            }
        }
        $data['program_progresses'] = $completion_array;
        return view('file.index', $data);
    }
public function index ( ) { $ data [ 'active_class' ] = 'file' ; $ client_id = Auth :: user ( ) -> id ; $ data [ 'completed_tasks' ] = ClientTask :: getTasks ( $ client_id , 'complete' ) ; $ programs = $ data [ 'client_programs' ] = ClientProgram :: programs ( $ client_id ) ; $ completion_array = [ ] ; foreach ( $ programs as $ key => $ program ) { foreach ( $ program -> programInfo as $ pi ) { $ completion_array [ $ pi -> program_name ] = $ this -> programProgress ( $ client_id , $ pi -> id ) ; } } $ data [ 'program_progresses' ] = $ completion_array ; return view ( 'file.index' , $ data ) ; }
Display a listing of the resource.
Display a listing of the resource .