Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

sync laravel

$user = User::find(1);

$user->roles()->detach([1, 2, 3]);

$user->roles()->attach([
    1 => ['expires' => $expires],
    2 => ['expires' => $expires],
]);
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #sync #laravel
ADD COMMENT
Topic
Name
4+1 =