Jane Doe Jane Doe - 1 month ago 12
PHP Question

How to increment with hash rocket?

How can I increment here? Instead of +1 it only shows '1'

\App\Coupon::where('coupon_id','=',$coupon[0]->coupon_id)->update(['no_applied' => 'no_applied'+1]);

Answer

You can use justr increment method:

App\Coupon::where('coupon_id','=',$coupon[0]->coupon_id)->increment('no_applied');