Assigning the role while user registration
问题 I am working in laravel and i am using the spatie permission package and I want to assign the different role for the user while registration I am using the radio button to get the role from a user such as editor ,writer,blogger how to I assign the different role to user based on the user input 回答1: In Laravel Auth\RegisterController you can modify the create() function. This is valid if you are using Spatie package. protected function create(array $data) { $user = User::create([ 'name' =>