Level 3
I assume you already queried your user. Then just query the wealth :
$wealth = DB::table('wealth')
->select('wealth','min_cash','max_cash')
->where('min_cash', '<=', $user->cash)
->where('max_cash', '>', $user->cash)
->get()
->first();
2 likes