Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to deduct user points when he buy something laravel

public function handle()
{
    $users = User::with('points')->get();
    foreach ($users as $user) {
        if ($user->achieved_points >= 5000) {
            $user->user->achieved_points->decrement($user->achieved_points);
        }
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #deduct #user #points #buy #laravel
ADD COMMENT
Topic
Name
7+7 =