<?php


namespace ModulesGarden\ProxmoxAddon\App\Models;


use ModulesGarden\ProxmoxAddon\Core\Models\ExtendedEloquentModel;

/**
 * @property int $id
 * @property int $hosting_id
 * @property int $vm_id
 * @property string $name
 * @property string $description
 * @property int $vmstate
 * @property string $period
 * @property int $run_every
 * @property string $days
 * @property string $start_time
 * @property string $updated_at
 * @property string $created_at
 * @method static $this ofHostingId($hostingId)
 */
class SnapshotJob extends ExtendedEloquentModel
{

    /** @var string */
    protected $table = 'SnapshotJob';
    protected $fillable   = ['id','hosting_id','vm_id','name','description','vmstate','period', 'run_every','days','start_time','updated_at','created_at'];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'days' => 'array',
    ];

    public function scopeOfHostingId($query, $hostingId)
    {
        return $query->where("hosting_id", $hostingId);
    }


}