本文整理汇总了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]);
}
示例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'));
}
示例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'));
}
示例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]);
}
示例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'));
}
示例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);
}
示例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'));
}
示例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]);
}
示例9: subjectRegistration
public function subjectRegistration()
{
$subjects = Subject::all();
$departments = Department::lists('name', 'id');
return view('admin.subject.register', compact('subjects', 'departments'));
}
示例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'));
}
示例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'));
}
示例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'));
}
示例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));
}
示例14: edit
public function edit($id)
{
$subject = Subject::find($id);
$departments = Department::lists('name', 'id');
return view('admin.subject.edit', compact('subject', 'departments'));
}
示例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');
}