Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel one to many relationship example

$user->roles()->attach($roleIds);
$user->roles()->detach($roleIds);
$user->roles()->sync($roleIds);
$user->roles()->toggle($roleIds);
 
PREVIOUS NEXT
Tagged: #laravel #relationship
ADD COMMENT
Topic
Name
2+2 =