vendredi 22 mai 2020

Laravel Spatie Call to undefined method Illuminate\Database\Query\Builder::assignRole()

Trying to do assignRole() to many users, but it show me Call to undefined method Illuminate\Database\Query\Builder::assignRole(). Is this spatie laravel bug?

$get_username = \App\Applicant::select('username')->whereIn('id', $ids);
        $updateUser = \App\User::whereIn('username', $get_username);
        $updateUser->assignRole('Applicant');
        $updateUser->save();

Any solution for bulk assignRole() in this case?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2zmt1l5
via IFTTT

Aucun commentaire:

Enregistrer un commentaire