RangeVm.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /* * ********************************************************************
  3. * ProxmoxAddon product developed. (Aug 22, 2018)
  4. * *
  5. *
  6. * CREATED BY MODULESGARDEN -> http://modulesgarden.com
  7. * CONTACT -> contact@modulesgarden.com
  8. *
  9. *
  10. * This software is furnished under a license and may be used and copied
  11. * only in accordance with the terms of such license and with the
  12. * inclusion of the above copyright notice. This software or any other
  13. * copies thereof may not be provided or otherwise made available to any
  14. * other person. No title to and ownership of the software is hereby
  15. * transferred.
  16. *
  17. *
  18. * ******************************************************************** */
  19. namespace ModulesGarden\ProxmoxAddon\App\Models;
  20. use Illuminate\Database\Eloquent\model as EloquentModel;
  21. use ModulesGarden\ProxmoxAddon as main;
  22. /**
  23. * Description of RangeVm
  24. *
  25. * @author Pawel Kopec <pawelk@modulesgardne.com>
  26. * @property main\Core\Models\Whmcs\Server $server
  27. * @property int $vmid_from
  28. * @property int $vmid_to
  29. * @property \ModulesGarden\ProxmoxAddon\Core\Models\Whmcs\Server $server
  30. * @method static this ofServerId($serverId)
  31. */
  32. class RangeVm extends EloquentModel
  33. {
  34. public $timestamps = false;
  35. protected $primaryKey = 'server_id';
  36. protected $table = 'mg_proxmox_vmranges';
  37. /**
  38. *
  39. *
  40. */
  41. protected $guarded = ['server_id'];
  42. /**
  43. *
  44. * @var array
  45. */
  46. protected $fillable = ['server_id', 'vmid_from', 'vmid_to'];
  47. protected $softDelete = false;
  48. public function server()
  49. {
  50. return $this->belongsTo(main\Core\Models\Whmcs\Server::class, 'server_id');
  51. }
  52. public function scopeOfServerId($query, $serverId)
  53. {
  54. return $query->where("server_id", $serverId);
  55. }
  56. }