We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我设计了现员工管理的多级联动功能 protected function form() { return Form::make(new Team(), function (Form $form) { $form->display('id'); $form->select('branch_id', '分公司')
->options(Branch::all()->pluck('name', 'id')) ->load('department_id', 'api/employee?type=department&q=:branch_id') ->required(); $form->select('department_id', '部门'); ->options(function ($id) { \Log::info('Department options callback with branch_id:', ['branch_id' => $id]); // 这里应该返回部门列表,假设Branch模型关联了Department模型 return Department::where('branch_id', $id)->pluck('name', 'id'); }); $form->text('name', '组名')->required(); $form->text('manager_id'); $form->display('created_at'); $form->display('updated_at'); }); }
发现api调用成功[2024-12-26 03:20:17] local.INFO: Cascade Request {"type":"department","parentId":"1"} [2024-12-26 03:20:17] local.INFO: Cascade Response {"options":{"Illuminate\Support\Collection":{"1":"企业部","2":"人才组","3":"企业部"}}} ,但是department $id 为null,无法select 部门
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description:
我设计了现员工管理的多级联动功能
protected function form()
{
return Form::make(new Team(), function (Form $form) {
$form->display('id');
$form->select('branch_id', '分公司')
发现api调用成功[2024-12-26 03:20:17] local.INFO: Cascade Request {"type":"department","parentId":"1"}
[2024-12-26 03:20:17] local.INFO: Cascade Response {"options":{"Illuminate\Support\Collection":{"1":"企业部","2":"人才组","3":"企业部"}}} ,但是department $id 为null,无法select 部门
Steps To Reproduce:
The text was updated successfully, but these errors were encountered: