Matteo De Blasis
Custom redirect after login from livewire component
@toeknee Do you think that is there a problem in my authenticate function? Because my problem is: if i login for the first time with role1 user, i do the logout and then try to login with role2 user, the application recognizes the right user (role2 user) but the system continue to redirect me to role1 user panel. Is it possible that there is a problem with session? or anything else?
4 replies
Default Select
Hello! i need to continue this post because, i have the same problem but maybe i don't understand how to use $set.
This is my select:
Select::make('category')->label('Category ad')
->options(function(Ad $record):array {
return array_keys($record->city->categories);
})
->default(fn (Set $set, Ad $record) => $set('category', array_search($record->category['name'], array_keys($record->city->categories))))
array_keys($record->city->categories) = ['Mobile', 'Phone', etc]
"category" is a real table column, but inside it i have a array like that ["name" => "Mobile", "point" => '1'], i try to use $set with array_search for having index of categories using "name" key, but nothing happens.
My form is loaded with EditAction.
Thanks you
5 replies