当前位置: 首页>>代码示例>>PHP>>正文


PHP Course::all方法代码示例

本文整理汇总了PHP中app\Course::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Course::all方法的具体用法?PHP Course::all怎么用?PHP Course::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Course的用法示例。


在下文中一共展示了Course::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: main

 public function main(Request $request)
 {
     switch ($request->data) {
         case "courses":
             $courses = Course::all();
             foreach ($courses as $course) {
                 $course["status"] = $course->seatsStatus();
                 $course["enrolled"] = $course->totalEnrolled();
                 $course["waitlist"] = $course->totalWaitlisted();
             }
             return response()->json(['courses' => $courses]);
         case "gpa":
             if ($request->has('student_id')) {
                 $student = User::find($request->get('student_id'));
                 return $student->gpa();
             } else {
                 return [];
             }
         case "classestaken":
             return Auth::user()->pastClasses();
         case "activecodes":
             $section_id = $request->get('section_id');
             return Auth::user()->returnActiveCodes($section_id);
         case "generateaddcode":
             $section_id = $request->get('section_id');
             Auth::user()->generateAddCode($section_id);
             return redirect()->action('CoursesController@addCode');
         default:
             return "no data specified";
     }
 }
开发者ID:emmendoza1986,项目名称:past_projects,代码行数:31,代码来源:APIController.php

示例2: new_student

 public function new_student()
 {
     $data['courses'] = Course::all();
     $data['majors'] = DB::table('tbl_major')->get();
     $data['religions'] = DB::table('tbl_religion')->get();
     return view(Api::getView(), $data);
 }
开发者ID:Jheysoon,项目名称:lcis-2,代码行数:7,代码来源:Registration.php

示例3: preform_fill

 public function preform_fill()
 {
     $courses = Course::all();
     // $attendances = Attendance::all();
     //$infos = Info::all();
     return view('attendances.preform_fill', compact('courses', 'infos'))->with('trainings', 'active');
 }
开发者ID:sanjidarafin,项目名称:tms_bard-laravel-,代码行数:7,代码来源:AttendanceController.php

示例4: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $courses = Course::all();
     $user = Auth::User();
     $user_id = $user->id;
     return view('trainee.create', compact('courses'))->with('user_id', $user_id);
 }
开发者ID:NabanitaBiswas,项目名称:Training_management_BARD,代码行数:12,代码来源:InfosController.php

示例5: index

 public function index()
 {
     $courses = Centre::with('courses')->get();
     $papers = Paper::with('courses')->get();
     $levels = Level::with('levels')->get();
     $courseNum = Course::all();
     return view('acca.base')->withCentres($courses)->withPapers($papers)->withLevels($levels)->with('courseNum', $courseNum);
 }
开发者ID:KaplanDigitalMarketing,项目名称:Timetables,代码行数:8,代码来源:AccaController.php

示例6: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     if (Auth::user()->id <= 38) {
         return view('professors.courses.index', ['courses' => Course::all()]);
     } else {
         return view('students.courses.index', ['courses' => Course::all()]);
     }
 }
开发者ID:emmendoza1986,项目名称:past_projects,代码行数:13,代码来源:CoursesController.php

示例7:

 function __construct()
 {
     $this->pageTitle = 'Courses';
     $this->pageModel = 'course';
     $this->pageSlug = $this->seoUrl($this->pageTitle);
     $this->courses = Course::all();
     $this->middleware('auth');
 }
开发者ID:purplenimbus,项目名称:Nimbus-SMS,代码行数:8,代码来源:CourseController.php

示例8: index

 public function index($survey_id = null)
 {
     $this->data['surveys'] = Survey::all();
     $gens = Gen::all();
     $this->data['gens'] = $gens;
     $this->data['courses'] = Course::all();
     $this->data['current_gen'] = Gen::getCurrentGen();
     return view('manage.survey', $this->data);
 }
开发者ID:Kaelcao,项目名称:colormev2,代码行数:9,代码来源:SurveyController.php

示例9: admin

 public function admin()
 {
     if ($user = Sentinel::check()) {
         $courses = Course::all();
         return view('courses.list', compact('courses'));
     } else {
         return redirect('/');
     }
 }
开发者ID:alexchirea,项目名称:Site-Coupons,代码行数:9,代码来源:CoursesController.php

示例10: numberOfViewsPerCourse

 public function numberOfViewsPerCourse()
 {
     $courses = Course::all();
     $viewsByCourse = [];
     foreach ($courses as $course) {
         $viewsByCourse[$course->name] = [$this->getCountOfCourseRoute($course)];
     }
     return $viewsByCourse;
 }
开发者ID:starkbaum,项目名称:sucon,代码行数:9,代码来源:StatisticsController.php

示例11: getIndex

 public function getIndex()
 {
     if (Request::ajax()) {
         $colleges = College::all();
         $courses = Course::all();
         $scholarships = Scholarship::all();
         $students = Student::where('archived', 0)->get();
         return compact('colleges', 'courses', 'scholarships', 'students');
     }
 }
开发者ID:humbleBeginner,项目名称:unp_guidanceRMS,代码行数:10,代码来源:AjaxSourceController.php

示例12: index

 public function index()
 {
     if (auth()->user()->can('admin')) {
         $courses = Course::all();
     } else {
         $courses = auth()->user()->courses()->get();
     }
     $coursesThatTeach = auth()->user()->coursesThatTeach()->get();
     return view('courses.index', compact('courses', 'coursesThatTeach'));
 }
开发者ID:abalozz,项目名称:glaciar,代码行数:10,代码来源:CoursesController.php

示例13: admin

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function admin()
 {
     $data = Request::all();
     $college = College::all();
     foreach ($college as $colleges) {
         $scollege[] = $colleges->scollege;
     }
     $course = Course::all();
     // return view('pages.administrator')->with('school',$school);
     return view('pages.administrator', compact('college'), compact('course'))->with('scollege', $scollege);
 }
开发者ID:jMelgar101,项目名称:Classnotch,代码行数:16,代码来源:NoteBookController.php

示例14: index

 public function index($handbook_id, $grade_id)
 {
     $handbook = CourseHandbook::find($handbook_id);
     // Get all courses and grades to fill the selects
     $courses = Course::all();
     $grades = Grade::all();
     // Select the grade and its courses associated in the current handbook
     $current_grade = Grade::find($grade_id);
     $current_courses = CourseGrade::where('course_handbook_id', $handbook_id)->where('grade_id', $grade_id)->get(['course_id']);
     $current_courses = $this->convertToCourseCollection($current_courses);
     return view('configuracion.asignar-cursos')->with(compact(['handbook', 'courses', 'grades', 'current_courses', 'current_grade']));
 }
开发者ID:JCarlosR,项目名称:sistema-academico,代码行数:12,代码来源:CourseGradeController.php

示例15: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $courses = Course::all();
     $user_id = Auth::User()->id;
     $trainee_info = Info::whereTrainee_login_id($user_id)->get();
     if ($trainee_info->isEmpty()) {
         $user_name = $this->trainee_name_by_user_id($user_id);
         return view('trainee.create')->with('user_id', $user_id)->with('courses', $courses)->with('user_name', $user_name);
     } else {
         $trainee_info = Info::whereTrainee_login_id($user_id)->firstOrFail();
         return redirect('trainee_profile/' . $trainee_info->id . '/edit_profile');
     }
 }
开发者ID:polycste,项目名称:training_management,代码行数:18,代码来源:InfosController.php


注:本文中的app\Course::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。