Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Laravel create method

Alternatively, there's also a create method which accepts a plain PHP array instead of an Eloquent model instance.
$post = Post::find(1);

$post->comments()->create([
    'message' => 'This is a new comment message'
]);
Source by riptutorial.com #
 
PREVIOUS NEXT
Tagged: #Laravel #create #method
ADD COMMENT
Topic
Name
3+1 =