laravel check record exists laravel 8 check if record exists laravel row exists

The solution for “laravel check record exists laravel 8 check if record exists laravel row exists” can be found here. The following code will assist you in solving the problem.

$user = User::where(’email’, ‘=’, Input::get(’email’))->first();
if ($user === null) {
// user doesn’t exist
}
$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
}

$result = User::where(‘id’,$id)->exists();

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in