Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel create or update eloquesnt

$flight = AppFlight::updateOrCreate(
    ['departure' => 'Oakland', 'destination' => 'San Diego'],
    ['price' => 99, 'discounted' => 1]
);
// updates price and discounted or creates a new record
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #laravel #create #update #eloquesnt
ADD COMMENT
Topic
Name
7+6 =