浏览代码

feat: ✨ Update last_billed to current time on unsuspend server

IceToast 3 年之前
父节点
当前提交
cad41ffb0a
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      app/Models/Server.php

+ 4 - 1
app/Models/Server.php

@@ -3,6 +3,7 @@
 namespace App\Models;
 
 use App\Classes\Pterodactyl;
+use Carbon\Carbon;
 use Exception;
 use GuzzleHttp\Promise\PromiseInterface;
 use Hidehalo\Nanoid\Client;
@@ -124,10 +125,12 @@ class Server extends Model
 
         if ($response->successful()) {
             $this->update([
-                'suspended' => null
+                'suspended' => null,
+                'last_billed' => Carbon::now()->toDateTimeString(),
             ]);
         }
 
+
         return $this;
     }