SnapshotJob.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. /** @var string */
  21. protected $table = 'SnapshotJob';
  22. protected $fillable = ['id','hosting_id','vm_id','name','description','vmstate','period', 'run_every','days','start_time','updated_at','created_at'];
  23. /**
  24. * The attributes that should be cast to native types.
  25. *
  26. * @var array
  27. */
  28. protected $casts = [
  29. 'days' => 'array',
  30. ];
  31. public function scopeOfHostingId($query, $hostingId) {
  32. return $query->where("hosting_id", $hostingId);
  33. }
  34. }