コード例 #1
0
ファイル: AdminComposer.php プロジェクト: alfrcr/ilearn
 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);
 }
コード例 #2
0
 /**
  * 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');
 }
コード例 #3
0
 /**
  * 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');
 }
コード例 #4
0
 /**
  * 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]);
 }
コード例 #5
0
ファイル: MonhocController.php プロジェクト: b0yblake1/duan
 function getIndex()
 {
     $data['list_subjects'] = Subject::all();
     return view('monhoc.index')->with('data', $data);
 }
コード例 #6
0
 /**
  * Display the index page
  *
  * @return \Illuminate\Http\Response
  */
 public function getIndex()
 {
     return new Response(view('index', ['subjectGroups' => Subject::all()->groupBy('group'), 'subjects' => Subject::all()]));
 }