Answers for "create or update in laravel if record not exist"

1

laravel update if exists or create

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

laravel 8 check if record exists

$subscription_count = DB::table('subscriptions')->where('pid_user',$pid_user)->count();

        //check if any subscription plan exists
        if($subscription_count == 0)
        { 
          //record does not exist 
        }else{
          //record exists
        }
Posted by: Guest on January-04-2022

Code answers related to "create or update in laravel if record not exist"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language