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


PHP Course::where方法代码示例

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


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

示例1: index

 /**
  * Show the application dashboard.
  *
  * @return Response
  */
 public function index()
 {
     // Get an array of courses which this instructor has created
     $courses = Course::where('instructor_id', '=', Auth::id())->get();
     // Render the view, passing the courses array into it
     return view('home')->with('courses', $courses);
 }
开发者ID:carbide20,项目名称:courses,代码行数:12,代码来源:HomeController.php

示例2: show

 public function show($slug)
 {
     $course = Course::where('slug', $slug)->firstOrFail();
     $breadcrumbs = array(action('HomeController@show') => 'Início', action('CourseController@all') => 'Cursos', action('CourseController@show', $slug) => $course->name);
     $previous = action('CourseController@all');
     return view('course', compact('breadcrumbs', 'previous', 'course'));
 }
开发者ID:joaopluis,项目名称:oldschool,代码行数:7,代码来源:CourseController.php

示例3: new_courses

 public function new_courses()
 {
     Course::where('offered_this_semester', true)->update(['offered_this_semester' => false]);
     $courseSeeder = new \CourseTableSeeder();
     $courseSeeder->run();
     return redirect(route('course.index'));
 }
开发者ID:AUCSC,项目名称:sac,代码行数:7,代码来源:CoursesController.php

示例4: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create($course_url, $stage_url)
 {
     $curso = Course::where('url', $course_url)->first();
     $etapa = Stage::where('url', $stage_url)->where('course_id', $curso->id)->first();
     $tiposItem = ItemType::all()->pluck('name', 'id');
     return view('pages.items.create', ['curso' => $curso, 'etapa' => $etapa, 'tiposItem' => $tiposItem]);
 }
开发者ID:juanfe190,项目名称:adminclubinnova,代码行数:12,代码来源:ItemController.php

示例5: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($course_url, $stage_url, $url)
 {
     $curso = Course::where('url', $course_url)->first();
     $etapa = Stage::where('url', $stage_url)->first();
     $item = Item::where('url', $url)->first();
     $tiposItem = ItemType::all()->pluck('name', 'id');
     return view('pages.items.edit', ['curso' => $curso, 'etapa' => $etapa, 'item' => $item, 'tiposItem' => $tiposItem]);
 }
开发者ID:Kenneth058,项目名称:adminclubinnova,代码行数:14,代码来源:ItemController.php

示例6: getCourseInCategory

 public function getCourseInCategory($category_slug, $course_slug)
 {
     $category = Category::where('slug', $category_slug)->first();
     // find id of slug
     $matchThese = ['category_id' => $category->id, 'slug' => $course_slug];
     $course = Course::where($matchThese)->first();
     return view('courses.show')->with('course', $course);
 }
开发者ID:dadigu,项目名称:haskolabru,代码行数:8,代码来源:CoursesController.php

示例7: getRemoved

 public function getRemoved($crn)
 {
     $course_id = \App\Course::where('crn', '=', $crn)->first()->id;
     $user = \Auth::user();
     $user->courses()->detach($course_id);
     \Session::flash('flash_message', 'The course was removed from your list!');
     return redirect()->back();
 }
开发者ID:dnvmbr,项目名称:p4,代码行数:8,代码来源:CourseController.php

示例8: showElectiveSelectionView

 public function showElectiveSelectionView()
 {
     // Get electives
     $electives = Course::where('dCode', Auth::guard('teacher')->user()->dCode)->where(function ($q) {
         $q->where('openElective', true)->orWhere('departmentElective', true);
     })->get();
     return view($this->electiveSelectionView, ['electives' => $electives]);
 }
开发者ID:prateekprshr-nith,项目名称:beautifulCode,代码行数:8,代码来源:HomeController.php

示例9: manageCourses

 /**
  * Show courses currently present in database
  *
  * @return mixed
  */
 public function manageCourses()
 {
     // Get the list of courses
     $courses = Course::where('dCode', Auth::guard('departmentStaff')->user()->dCode)->orderBy('semNo', 'asc')->paginate(8);
     // Department code
     $dCode = Auth::guard('departmentStaff')->user()->dCode;
     return view($this->courseManagementView, ['courses' => $courses, 'count' => 0, 'dCode' => $dCode]);
 }
开发者ID:prateekprshr-nith,项目名称:beautifulCode,代码行数:13,代码来源:HomeController.php

示例10: addAcademics

 protected function addAcademics()
 {
     // Academic details.
     $this->add('college_id', 'entity', ['label' => 'College', 'class' => 'App\\College', 'selected' => College::where('name', 'None')->value('id')])->add('course_id', 'entity', ['label' => 'Course', 'class' => 'App\\Course', 'property' => 'course_with_type', 'query_builder' => function ($obj) {
         return $obj::get();
     }, 'selected' => Course::where('name', 'None')->value('id')])->add('start_year', 'number', ['label' => 'Matriculation year', 'default_value' => Carbon::today()->year])->add('end_year', 'number', ['label' => 'Graduation year (estimated)', 'default_value' => Carbon::today()->year + 3]);
     return $this;
 }
开发者ID:CUMSA,项目名称:members,代码行数:8,代码来源:MembersSignupForm.php

示例11: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     //course is determined by the button pushed in the courses index page
     $course = Course::where('course_id', $id)->lists('course_name', 'course_id');
     //user role must be 3, meaning this retrieves a student list with no admins/instructors
     $users = User::where('user_role', 3)->lists('user_name', 'user_id');
     return view('courses.rosters')->with('course', $course)->with('users', $users);
 }
开发者ID:bigschlong69,项目名称:capstoneAll,代码行数:14,代码来源:RostersController.php

示例12: __construct

 /**
  * Create a new user controller instance.
  *
  * @return void
  */
 public function __construct()
 {
     $this->priviledge_user();
     $this->_user = \Auth::user();
     if (2 == $this->_user->role_id) {
         $this->_query_connect = "=";
         $this->_query_value = $this->_user->department_id;
     }
     $this->_plan_courses = Course::where('department_id', $this->_query_connect, $this->_query_value)->lists('name', 'id');
     $this->_plan_curriculums = Curriculum::lists('name', 'id');
 }
开发者ID:zheralfin,项目名称:oras,代码行数:16,代码来源:PlansController.php

示例13: getByUniversity

 public function getByUniversity($code)
 {
     $university = Course::where('university_code', $code)->get();
     $validator = Validator::make(array('code' => $code), array('code' => array('required', 'regex:/(?i)^[a-z]+/')));
     if ($validator->fails()) {
         return response()->json(['error' => true, 'description' => 'only alphabets are allowed']);
     }
     if ($university == null) {
         return response()->json(['error' => true, 'description' => 'code is not valid']);
     }
     return response()->json(['error' => false, 'topic' => $university]);
 }
开发者ID:rohan1309,项目名称:studyhere,代码行数:12,代码来源:CoursesController.php

示例14: showCourseManagementView

 /**
  * Show courses currently taught by teacher
  *
  * @return mixed
  */
 public function showCourseManagementView()
 {
     // Get the courses teacher is teaching
     $teacherCourses = Auth::guard('teacher')->user()->teachingDetails;
     $teacherCourseCodes = [];
     foreach ($teacherCourses as $teacherCourse) {
         array_push($teacherCourseCodes, $teacherCourse->courseCode);
     }
     // Get a list of all courses
     $courses = Course::where('dCode', Auth::guard('teacher')->user()->dCode)->whereNotIn('courseCode', $teacherCourseCodes)->get();
     return view($this->courseView, ['teacherCourses' => $teacherCourses, 'courses' => $courses]);
 }
开发者ID:prateekprshr-nith,项目名称:sisnew,代码行数:17,代码来源:AcademicsController.php

示例15: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     do {
         $videoCode = self::VIDEO_PRE_CODE . StringUtil::getRandomString();
         $courses = Course::where('video_code', $videoCode)->first();
         if (empty($courses)) {
             $request['video_code'] = $videoCode;
             break;
         }
     } while (true);
     return $next($request);
 }
开发者ID:Kenneth058,项目名称:adminclubinnova,代码行数:19,代码来源:GenerateVideoCourseCode.php


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