Weisen Sie dem Benutzer Rollen zu
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);