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


PHP Department::lists方法代码示例

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


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

示例1: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $departments = Department::lists('name', 'name');
     $rooms = Room::lists('name', 'name');
     $days = array('Saturday' => 'Saturday', 'Sunday' => 'Sunday', 'Monday' => 'Monday', 'Tuesday' => 'Tuesday', 'Wednesday' => 'Wednesday', 'Thursday' => 'Thursday', 'Friday' => 'Friday');
     return view('layouts.allocateClassroom', ['departments' => $departments, 'overlap' => null, 'rooms' => $rooms, 'days' => $days]);
 }
开发者ID:arnabrahman,项目名称:Course-and-Result-Management,代码行数:12,代码来源:ClassroomController.php

示例2: doChooseEmployee

 /**
  * User chose single employee from dropdown to be edited
  *
  * @param Request $request
  * @return mixed
  */
 public function doChooseEmployee(Request $request)
 {
     $employee = Employee::find($request->input('choose'));
     $dept = ['' => 'Choose...'] + Department::lists('name', 'id')->all();
     $location = ['' => 'Choose...'] + Location::lists('name', 'id')->all();
     return view('admin.edit-employee', compact('dept', 'location', 'employee'));
 }
开发者ID:heidilux,项目名称:Laravel-Company-Directory,代码行数:13,代码来源:EmployeeController.php

示例3: show

 public function show($id)
 {
     $user = User::find($id);
     $sections = Section::lists('name', 'id');
     $departments = Department::lists('name', 'id');
     $subjects = $user->type == 'student' ? $user->studentSubjects : $user->teacherSubjects;
     return view('admin.user.show', compact('user', 'sections', 'subjects', 'departments'));
 }
开发者ID:MangTomas23,项目名称:cnhs-portal,代码行数:8,代码来源:UserController.php

示例4: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $departments = Department::lists('name', 'code');
     //Get the names of departments
     $semesters = Semester::lists('name', 'id');
     //Get the names of semesters
     return view('layouts.saveCourse', ['departments' => $departments, 'semesters' => $semesters]);
 }
开发者ID:arnabrahman,项目名称:Course-and-Result-Management,代码行数:13,代码来源:CourseController.php

示例5: getRegister

 public function getRegister()
 {
     if (!Entrust::can('create_user')) {
         return redirect('/dashboard')->withErrors(config('constants.NA'));
     }
     $departments = Department::lists('department_name', 'id')->all();
     if (Entrust::hasRole('admin')) {
         $roles = Role::lists('name', 'id')->all();
     } else {
         $roles = Role::where('name', '!=', 'admin')->lists('name', 'id')->all();
     }
     return view('user.create', compact('departments', 'roles'));
 }
开发者ID:EneaWeb,项目名称:aliangel,代码行数:13,代码来源:AuthController.php

示例6: create

 public function create(Request $request)
 {
     $newBusinessPlan = new BusinessPlan();
     $newBusinessPlan->start = date($request['sYear'] . '-01-01 00:00:00');
     $newBusinessPlan->end = date($request['eYear'] . '-12-31 00:00:00');
     $newBusinessPlan->save();
     foreach (array_keys($request['data']) as $idx) {
         $key = array_keys($request['data'][$idx])[0];
         $newGoal = new Goat();
         $newGoal->type = 'G';
         $newGoal->parent_id = null;
         $newGoal->description = $key;
         $newGoal->priority = 0;
         $newGoal->complete = false;
         $newGoal->goal_type = 'B';
         $newGoal->due_date = null;
         $newGoal->budget = 0;
         $newGoal->bid = $newBusinessPlan->id;
         $newGoal->save();
         foreach ($request['data'][$idx][$key] as $obj) {
             $newObj = new Goat();
             $newObj->type = 'O';
             $newObj->parent_id = $newGoal->id;
             $newObj->description = $obj;
             $newObj->priority = 0;
             $newObj->complete = false;
             $newObj->goal_type = 'B';
             $newObj->due_date = null;
             $newObj->budget = 0;
             $newObj->bid = $newBusinessPlan->id;
             $newObj->save();
         }
     }
     foreach (Department::lists('name') as $dept_name) {
         $newGoal = new Goat();
         $newGoal->type = 'G';
         $newGoal->parent_id = null;
         $newGoal->description = $dept_name . " Goals";
         $newGoal->priority = 0;
         $newGoal->complete = false;
         $newGoal->goal_type = 'D';
         $newGoal->due_date = null;
         $newGoal->budget = 0;
         $newGoal->bid = $newBusinessPlan->id;
         $newGoal->save();
     }
     return response()->json([], 200);
 }
开发者ID:macewanCS,项目名称:DreamSolutions,代码行数:48,代码来源:CreatePlanController.php

示例7: profile

 /**
  * Show the application calendar.
  *
  * @return \Illuminate\Http\Response
  */
 public function profile()
 {
     $roles = \App\Role::lists('name', 'id');
     $departments = \App\Department::lists('name', 'id');
     return view('dashboard.profile', compact('departments', 'roles'));
 }
开发者ID:zheralfin,项目名称:oras,代码行数:11,代码来源:DashboardController.php

示例8: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $departments = Department::lists('name', 'name');
     $designations = Designation::lists('name', 'name');
     return view('layouts.saveTeacher', ['departments' => $departments, 'designations' => $designations]);
 }
开发者ID:arnabrahman,项目名称:Course-and-Result-Management,代码行数:11,代码来源:TeacherController.php

示例9: subjectRegistration

 public function subjectRegistration()
 {
     $subjects = Subject::all();
     $departments = Department::lists('name', 'id');
     return view('admin.subject.register', compact('subjects', 'departments'));
 }
开发者ID:MangTomas23,项目名称:cnhs-portal,代码行数:6,代码来源:AdminController.php

示例10: edit

 public function edit(User $user)
 {
     if (!Entrust::can('edit_user')) {
         return redirect('/dashboard')->withErrors(config('constants.NA'));
     }
     if (!Helper::getMode()) {
         return redirect()->back()->withErrors(config('constants.DISABLE_MESSAGE'));
     }
     foreach ($user->roles as $role) {
         $role_id = $role->id;
     }
     $departments = Department::lists('department_name', 'id')->all();
     $roles = Role::lists('display_name', 'id')->all();
     $custom_field_values = Helper::getCustomFieldValues($this->form, $user->id);
     return view('user.edit', compact('user', 'departments', 'roles', 'role_id', 'custom_field_values'));
 }
开发者ID:EneaWeb,项目名称:aliangel,代码行数:16,代码来源:UserController.php

示例11: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $estimate = Estimate::findOrFail($id);
     $vehicles = Vehicle::lists('reg_no', 'id')->all();
     $customer_list = Customer::lists('name', 'id')->all();
     $departments = Department::lists('name', 'id');
     $items = Item::lists('name', 'id')->all();
     $estimate_details = DB::table('estimate_details')->where('estimate_id', '=', $id)->get();
     return view('estimates.edit', compact('estimate', 'vehicles', 'estimate_details', 'customer_list', 'departments', 'items'));
 }
开发者ID:suxiid,项目名称:application,代码行数:16,代码来源:EstimatesController.php

示例12: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     //
     $post = Post::findOrFail($id);
     //Populate the select(dropdowns)
     //$department_options = Department::lists('name', 'id');
     //$department_id = $post->department_id;
     $department_options = Department::lists('name', 'id');
     $department_selected = $post->departments->lists('id');
     //$project_options = Project::lists('name', 'id');
     //$project_id = $post->project_id;
     $source_options = Source::lists('name', 'id');
     $source_selected = $post->sources->lists('id');
     $staff_options = Staff::select('Id', DB::raw('CONCAT(first_name, " ", last_name) AS full_name'))->orderBy('first_name')->lists('full_name', 'Id');
     $staff_selected = $post->staffs->lists('id');
     // Show the page
     return view('posts.forms.edit', compact('post', 'department_options', 'department_selected', 'source_options', 'source_selected', 'staff_options', 'staff_selected'));
 }
开发者ID:mycrazydog,项目名称:mm-shibboleth,代码行数:24,代码来源:PostsController.php

示例13: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     //
     $authuser = Auth::user();
     $user = User::findOrFail($id);
     $depts = Department::lists('name', 'department_id');
     return view('superadmin.edit_user', array('authuser' => $authuser, 'user' => $user, 'depts' => $depts));
 }
开发者ID:roannadavid,项目名称:sec,代码行数:14,代码来源:SuperAdminController.php

示例14: edit

 public function edit($id)
 {
     $subject = Subject::find($id);
     $departments = Department::lists('name', 'id');
     return view('admin.subject.edit', compact('subject', 'departments'));
 }
开发者ID:MangTomas23,项目名称:cnhs-portal,代码行数:6,代码来源:SubjectController.php

示例15: __construct

 /**
  * Create a new user controller instance.
  *
  * @return void
  */
 public function __construct()
 {
     $this->priviledge_user();
     $this->_user_roles = Role::lists('name', 'id');
     $this->_user_departments = Department::lists('name', 'id');
 }
开发者ID:zheralfin,项目名称:oras,代码行数:11,代码来源:UsersController.php


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