CustomField.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace ModulesGarden\ProxmoxAddon\App\Models\Whmcs;
  3. /**
  4. * Description of CustomField
  5. *
  6. * @property int id
  7. * @property string type
  8. * @property string relid
  9. * @property string fieldname
  10. * @property string fieldtype
  11. * @property string description
  12. * @property string fieldoptions
  13. * @property string regexpr
  14. * @property string adminonly
  15. * @property string required
  16. * @property string showorder
  17. * @property string showinvoice
  18. * @property string sortorder
  19. * @property string created_at
  20. * @property string updated_at
  21. * @method static $this ofClient()
  22. * @method $this ofName()
  23. * @property CustomFieldValue $customFieldValue
  24. */
  25. class CustomField extends \ModulesGarden\ProxmoxAddon\Core\Models\Whmcs\CustomField
  26. {
  27. public function scopeOfClient($query)
  28. {
  29. return $query->where('type', 'client');
  30. }
  31. public function scopeOfName($query, $name)
  32. {
  33. return $query->where('fieldname', 'LIKE', "{$name}|%");
  34. }
  35. public function customFieldValue()
  36. {
  37. return $this->hasMany(CustomFieldValue::class,"fieldid");
  38. }
  39. }