我可以使用以下代码检查记录是否为用户存在,但我只想查找记录是否存在。
$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');
}