Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel add attribute to model

$user = User::find(1);

// add occupation to user instance
$user->setAttribute('occupation', 'Web Developer');
 
PREVIOUS NEXT
Tagged: #laravel #add #attribute #model
ADD COMMENT
Topic
Name
8+4 =