Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel firstorcreate with multiple parameters

The firstOrCreate method takes two arrays, the first of which is all of the attributes to find an existing record, the second being any additional attributes that a newly created record should get (combined with the values in the first array). So you can specify multiple key/value pairs in both arrays
Source by laracasts.com #
 
PREVIOUS NEXT
Tagged: #laravel #firstorcreate #multiple #parameters
ADD COMMENT
Topic
Name
5+7 =