本文整理汇总了PHP中app\Course::lists方法的典型用法代码示例。如果您正苦于以下问题:PHP Course::lists方法的具体用法?PHP Course::lists怎么用?PHP Course::lists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Course
的用法示例。
在下文中一共展示了Course::lists方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$trainees = Registration::lists('english_name', 'id');
$courses = Course::lists('course_name', 'id');
$data = TraineeCourse::whereId($id)->firstOrFail();
return view('traineeCourse.edit', compact('trainees', 'courses', 'data'));
}
示例2: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$trainer_course = TrainerCourse::whereid($id)->firstOrfail();
$trainers = Trainer::lists('name', 'id');
$courses = Course::lists('course_name', 'id');
return view('TrainerCoursesRelation.edit', compact('trainer_course', 'trainers', 'courses'));
}
示例3: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$trainer_course = TrainerCourse::whereid($id)->firstOrfail();
$trainers = DB::table('users')->leftjoin('role_user', 'users.id', '=', 'role_user.user_id')->where('role_user.role_id', 2)->select('users.id as id', 'users.name as name')->lists('name', 'id');
$courses = Course::lists('course_name', 'id');
return view('TrainerCoursesRelation.edit', compact('trainer_course', 'trainers', 'courses'));
}
示例4: run
public function run()
{
$faker = Faker::create();
$courseIds = Course::lists('id')->all();
$studentIds = Student::lists('id')->all();
// dd($studentIds);
foreach (range(1, count($courseIds)) as $index) {
DB::table('course_student')->insert(['course_id' => $faker->randomElement($courseIds), 'student_id' => $faker->randomElement($studentIds)]);
}
}
示例5: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$courses = Course::lists('course_name', 'id');
$data = Exam::findOrNew($id);
return view('exam.edit', compact('data', 'courses'));
}
示例6: selectTrack
public function selectTrack($TrainingId)
{
$courses = Course::lists('course_name', 'id');
$courseId = Course::wheretraining_id($TrainingId)->get();
//dd($courseId);
return view('traineeCourse/selectTrack', compact('courses', 'TrainingId', 'courseId'));
}
示例7: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$schedules = Schedule::find($id);
$academicRegistrations = AcademicRegistration::lists('academic_year', 'id');
$programStudies = ProgramStudy::lists('name', 'id');
$courses = Course::lists('course_name', 'id');
$studies = Study::lists('study_name', 'id');
$lecturers = Lecturer::lists('name', 'id');
$days = Day::lists('day', 'id');
return view('dashboard.admin.schedule.edit', ['schedule' => $schedules, 'academicRegistration' => $academicRegistrations, 'programStudy' => $programStudies, 'course' => $courses, 'study' => $studies, 'lecturer' => $lecturers, 'day' => $days]);
}