// SYSTEM PANEL //
[ROOT]
/
mnt
/
pleskStorage
/
vhosts
/
kodsolutions.net
/
subdomains
/
go-rent.kodsolutions.net
/
app
/
Services
/
Points
[ PARENT ]
EDIT :: PointsService.php
<?php namespace App\Services\Points; use App\Models\Point; use Carbon\Carbon; class PointsService { public function assignPointsForOrder(\App\Models\Booking\Order $order) { $user = $order->user; $points = floor($order->total_price / 100) * 10; $expiresAt = Carbon::now()->addMonths(1); return Point::create([ 'user_id' => $user->id, 'order_id' => $order->id, 'points' => $points, 'message' => "Points for dialing a number #{$order->code}", 'expires_at' => $expiresAt, ]); } }
SAVE
CANCEL