當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。