Tetapkan peran untuk pengguna
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);