소스 검색

feat: ✨ Update last_billed to current time on unsuspend server

IceToast 3 년 전
부모
커밋
2e6c03e3cc
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      app/Models/Server.php

+ 3 - 0
app/Models/Server.php

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