i am making a free bonus plan in my laravel web . i want if a user has already claimed bonus plan then he should not be able to claim it again . i want that if pricing_plan_id is already in plan_logs with that user id it should return error.
i am able to check if record exist for user or not with below code but i want to only find if that it exist or not.
$plan = PlanLog::where('user_id', $user->id)->where('pricing_plan_id', $plan->cat_id)->get();
if (empty($plan)) {
return redirect()->back()->with('type','danger')->with('message','please add funds atleast once');
}