alijumaan / laravel-ecommerce

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maintain consistency

elviskc091 opened this issue · comments

https://github.com/alijumaan/Laravel-Ecommerce/blob/4b88d4b63f121e0dc837a8518f39df93f86d22d1/app/Http/Controllers/Backend/CouponsController.php#L52

Try to maintain consistency through out your controller and everything in general.

Here you are using
$coupon->save()
While in other controllers like PageController update method you are using
$page->update($request->all());

By the way avoid using $request->all() for security reasons. :)

So in the end have something like $coupon->update($request->only('foo', 'bar'));