Answers for "laravel check if exists add else not"

1

laravel update if exists or create

$flight = AppFlight::updateOrCreate(
    ['departure' => 'Oakland', 'destination' => 'San Diego'],
    ['price' => 99]
);
Posted by: Guest on June-20-2021
0

create if not exist laravel

if(!Numbers::where('country',$country)->exists()){
    Numbers::Create([
      'country'    => $country
      ]);
}
Posted by: Guest on July-08-2021

Code answers related to "laravel check if exists add else not"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language