How can we add and remove tab after Bio in users?

How can we add and remove permission tab in users i want to add new tab after Bio

Is this the V1 ? See below if it applies (I think it should)

In V2 and V3, you can add in your Plugin.php (boot method) something like this to add fields in a new tab:

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;
            }

            $widget->addTabFields([
                'yourtab[yourfield]' => [
                    'label' => '',
                    'span' => '', 
                    'type' => '',
                ],
            ]);
        });

And, if you want to remove the permissions tab (make sure you can manage it somewhere else?), looks like there is a function in modules\backend\widgets\Form.php.

public function removeTab($name) {}

1 Like