Files
portal-api/app/Models/VmProvisionLock.php

16 lines
350 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class VmProvisionLock extends Model
{
protected $fillable = ['customer_id', 'order_item_id', 'status'];
public static function isRunning(int $customerId): bool
{
return static::where('customer_id', $customerId)->where('status', 'running')->exists();
}
}