Answers for "laravel check if how many times record exists"

PHP
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
1

laravel how to check if there are record exists

//User::  User is going to be what model you use.
//$user can be what ever you need it to be
$user = User::where('email', '=', Input::get('email'))->first();
if ($user != null) {
   // Record does exist
}
Posted by: Guest on February-22-2021

Code answers related to "laravel check if how many times record exists"

Browse Popular Code Answers by Language