Master-users have NULL parent_id. Sub-users have parent_id with id of master-user. There is only this two layers of users.
In users grid I have a list of master-users.
protected function form()
{
$form = new Form(new Client());
$form->text('last_name', __('Прізвище'))->required();
$form->text('first_name', __('Ім\'я'))->required();
$form->date('birthday', __('День народження'));
$form->phonenumber('phone', __('Телефон'));
$form->email('email', __('Email'));
$form->belongsTo('parent_id', ClientSelect::class, 'Контактна особа для');
return $form;
}
How can I add to editing form of master-user a list of sub-users? This list should have links to edit those sub-users.
How can I get the current user's data in Controller Form? I need to show some elements oft he form only if parent_id == null.
I have a list of users and sub-users.
Database:
Master-users have NULL
parent_id
. Sub-users haveparent_id
withid
of master-user. There is only this two layers of users. In users grid I have a list of master-users.Controller Grid:
Controller Form:
How can I add to editing form of master-user a list of sub-users? This list should have links to edit those sub-users. How can I get the current user's data in Controller Form? I need to show some elements oft he form only if
parent_id == null
.