SnapshotJob.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace ModulesGarden\ProxmoxAddon\App\Models;
  3. use ModulesGarden\ProxmoxAddon\Core\Models\ExtendedEloquentModel;
  4. /**
  5. * @property int $id
  6. * @property int $hosting_id
  7. * @property int $vm_id
  8. * @property string $name
  9. * @property string $description
  10. * @property int $vmstate
  11. * @property string $period
  12. * @property int $run_every
  13. * @property string $days
  14. * @property string $start_time
  15. * @property string $updated_at
  16. * @property string $created_at
  17. * @method static $this ofHostingId($hostingId)
  18. */
  19. class SnapshotJob extends ExtendedEloquentModel
  20. {
  21. /** @var string */
  22. protected $table = 'SnapshotJob';
  23. protected $fillable = ['id','hosting_id','vm_id','name','description','vmstate','period', 'run_every','days','start_time','updated_at','created_at'];
  24. /**
  25. * The attributes that should be cast to native types.
  26. *
  27. * @var array
  28. */
  29. protected $casts = [
  30. 'days' => 'array',
  31. ];
  32. public function scopeOfHostingId($query, $hostingId)
  33. {
  34. return $query->where("hosting_id", $hostingId);
  35. }
  36. }