vildanbina / livewire-tabs

Livewire component that provides you with a tabs that supports multiple tabs form while maintaining state.
MIT License
48 stars 10 forks source link

Show Tabs Item on the basis of roles #4

Open humayunjavaid opened 1 week ago

humayunjavaid commented 1 week ago

How can we implement role base tab hide and show?

vildanbina commented 1 week ago

You can customize the TabComponent class in the tabs() method. There you can apply any kind of filter to the tabs you want to return

humayunjavaid commented 1 week ago

One more issue

i have made location tab but on submit General tab 's save function calls? how to call Location tab save method to save location form fields?

for now i override save function like following

`public function save(): void {

    $this->callHook('beforeValidate');

    $this->tabsValidation();

    $this->callHook('afterValidate');

    $state = $this->mutateStateBeforeSave($this->getState());

    $this->callHook('beforeSave');

    $this->getCurrentTab()->save($state);

    $this->callHook('afterSave');
}`