Search
 
SCRIPT & CODE EXAMPLE
 

PHP

spatie give permissionto and assign role

// Adding permissions to a user
$user->givePermissionTo('edit articles');

// Adding permissions via a role
$user->assignRole('writer');

$role->givePermissionTo('edit articles');
Comment

install spatie for role and permissions

composer require spatie/laravel-permission
Comment

PREVIOUS NEXT
Code Example
Php :: laravel_login1 
Php :: php namespaces 
Php :: how to reverse a string in php 
Php :: doble quotes in csv export php 
Php :: Use external variable in array_filter 
Php :: laravel get url parameter value in controller 
Php :: laravel query relationship nested 
Php :: php mysql update all rows in table random values 
Php :: laravel digits between does not working 
Php :: add data in textarea with php variable 
Php :: tidak bisa install php7.3 di ubuntu 20.04 
Php :: change sender name laravel 
Php :: octobercms mail register 
Php :: phpspreadsheet select sheet 
Php :: cannot be cast automatically to type integer laravel 
Php :: woocommerce_product_is_on_sale filter 
Php :: View [layouts.master] not found 
Php :: php obfuscate email 
Php :: php check if stdclass object has property 
Php :: Create progress bar with Laravel 
Php :: Laravel Unique Multiple Column validation 
Php :: laravel where condition with if 
Php :: php class instance 
Php :: laravel request protected prop 
Php :: php access multidimensional array by string 
Php :: magento 2 laravel valet 502 bad gateway 
Php :: doctrine orm refresh 
Php :: httpclient add authorization header symphony 
Php :: @yield extends laravel 
Php :: Undefined property: IlluminateDatabaseQueryBuilder::$name 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =