I have free bonus system on my web. In this system. There are 2 tables 1 "deposit " and other is plan. In deposit there is column "plan_id" I want if user has record with plan_d 8 then he should alert message ." You already subscribe free bonus"
I tried following.
$sit = Deposit::where('plan_id', Plan::id)->first();
if ($sit == 8) {
session()->flash('message', 'Please Add fund at least once to withdraw life time.');
Session::flash('type', 'warning');
Session::flash('title', 'warning');
return redirect()->back();
}