Hi,
Event::listen('backend.form.extendFields', function ($widget) {
if (!$widget->getController() instanceof \RainLab\User\Controllers\Users) {
return;
}
if (!$widget->model instanceof \RainLab\User\Models\User) {
return;
}
if (!$widget->model->exists) {
return;
}
UserProfile::getFromUser($widget->model);
$widget->addTabFields([
'dealers' => [
'label' => 'larnet.osm::lang.backend.user.form.dealers',
'tab' => 'Attached dealers',
'type' => 'relation',
'readOnly' => true
],
]);
});
Adding the ‘readOnly’ to true, it will also put the ‘Groups’ relation disabled (it shouldn’t).