27 lines
565 B
PHP
27 lines
565 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class VmBackup extends Model
|
|
{
|
|
protected $fillable = [
|
|
'customer_id', 'user_id', 'storage', 'volume_id', 'status', 'size_bytes', 'completed_at',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'size_bytes' => 'integer',
|
|
'completed_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function vm(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Customer::class, 'customer_id');
|
|
}
|
|
}
|