Atribuir funções ao usuário
use App\Models\User;
$user = User::find(1);
$user->roles()->attach($roleId);
Brainy Beetle
use App\Models\User;
$user = User::find(1);
$user->roles()->attach($roleId);