Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how get role of user in laravel spatie

$user->getRoleNames()
Comment

get users of specific role laravel role spatie

$users = User::role('writer')->get(); 
Comment

laravel spatie asigne role

$user->assignRole('writer');

// You can also assign multiple roles at once
$user->assignRole('writer', 'admin');
// or as an array
$user->assignRole(['writer', 'admin']);
Comment

laravel spatie asigne role

$role->givePermissionTo($permission);
$permission->assignRole($role);
Comment

get users by role name - spatie/laravel-permission

User::whereHas("roles", function($q){ $q->where("name", "Member"); })->get()
Comment

laravel spatie asigne role

$role->syncPermissions($permissions);
$permission->syncRoles($roles);
Comment

PREVIOUS NEXT
Code Example
Php :: php json encode 
Php :: php month single digit 
Php :: laravel share on whatsapp link 
Php :: woocommerce check if user is logged in 
Php :: php change array into comma delimited string 
Php :: mysql_fetch_array php 
Php :: laravel api form request validation 404 
Php :: php header pdf 
Php :: time to string in php 
Php :: Download multiple files as zip in PHP 
Php :: laravel run seeder enter timestamps 
Php :: delete record using laravel 
Php :: laravel get route in unauthenticated 
Php :: mysqli loop 
Php :: php var dump into string 
Php :: php full day name 
Php :: laravel blade get array count in Blade 
Php :: convert multidimensional array to single array php 
Php :: deactivate auto update wordpress plugins 
Php :: delete all cookies in php 
Php :: How to get a WordPress post by slug 
Php :: check if a string contains a substring in php 
Php :: load database in codeigniter 
Php :: yii2 postgresql connection 
Php :: how to convert array to string in php 
Php :: continue not in the loop or switch 
Php :: how delete the table in laravel in the commend 
Php :: laravel collection orderby 
Php :: get data in descending order in laravel 
Php :: PHP scandir() Function 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =