public function compose(View $view) { $data = []; $data['profile'] = Auth::user(); $data['majors'] = Major::all(); $data['subjects'] = Subject::all(); $data['classrooms'] = Classroom::all(); $view->with('lms', $data); }
/** * Register any application services. * * @return void */ public function register() { // Bind our eloquent subject collection to the interface $this->app->singleton('App\\Contracts\\SubjectsCollectionInterface', function () { return Subject::all(); }); // Use speedtest tester for tests $this->app->bind('App\\Contracts\\TesterInterface', 'App\\Services\\SpeedtestTester'); }
/** * Execute the console command. * * @return mixed */ public function handle() { if (Config::get('app.worker_id') != Config::get('app.generator_worker_id') && !App::isLocal()) { return; } $this->line('Generating status page...'); $viewVariables = ['subjectGroups' => Subject::all()->groupBy('group'), 'subjects' => Subject::all()]; Storage::disk('local')->put('status.html', view('index', $viewVariables)); $this->line('Finished'); }
/** * Display a listing of the resource. * * @return Response */ public function index($id) { $subjects = Subject::all(); $return = []; foreach ($subjects as $key => $subject) { if ($subject->course->id == $id) { $return[] = ["id" => $subject->id, "name" => $subject->name]; } } return view('subject.index')->with(['subjects' => json_encode($return), 'id' => $id]); }
function getIndex() { $data['list_subjects'] = Subject::all(); return view('monhoc.index')->with('data', $data); }
/** * Display the index page * * @return \Illuminate\Http\Response */ public function getIndex() { return new Response(view('index', ['subjectGroups' => Subject::all()->groupBy('group'), 'subjects' => Subject::all()])); }