HostingAddon.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. namespace ModulesGarden\ProxmoxAddon\Core\Models\Whmcs;
  3. use \Illuminate\Database\Eloquent\Model as EloquentModel;
  4. /**
  5. * Description of Product
  6. *
  7. * @author Paweł Złamaniec <pawel.zl@modulesgarden.com>
  8. */
  9. class HostingAddon extends EloquentModel
  10. {
  11. /**
  12. * Table name
  13. *
  14. * @var string
  15. */
  16. protected $table = 'tblhostingaddons';
  17. protected $primaryKey = 'id';
  18. /**
  19. * Eloquent guarded parameters
  20. * @var array
  21. */
  22. protected $guarded = ['id'];
  23. /**
  24. * Eloquent fillable parameters
  25. * @var array
  26. */
  27. protected $fillable = ['orderid', 'hostingid', 'addonid', 'userid', 'server', 'name', 'setupfee', 'recuring', 'billingcycle', 'tax', 'status', 'regdate', 'nextduedate', 'nextinvoicedate', 'termination_date', 'peymentmethod', 'notes'];
  28. /**
  29. * Indicates if the model should soft delete.
  30. *
  31. * @var bool
  32. */
  33. protected $softDelete = false;
  34. public function __construct(array $attributes = [])
  35. {
  36. parent::__construct($attributes);
  37. }
  38. /**
  39. * Indicates if the model should be timestamped.
  40. *
  41. * @var bool
  42. */
  43. public $timestamps = false;
  44. public function addon()
  45. {
  46. return $this->belongsTo("ModulesGarden\ProxmoxAddon\Core\Models\Whmcs\Addon", "addonid");
  47. }
  48. public function hosting()
  49. {
  50. return $this->belongsTo("ModulesGarden\ProxmoxAddon\Core\Models\Whmcs\Hosting", "hostingid");
  51. }
  52. public function order()
  53. {
  54. return $this->belongsTo("ModulesGarden\ProxmoxAddon\Core\Models\Whmcs\Order", "orderid");
  55. }
  56. public function getBillingcycleFriendlyAttribute()
  57. {
  58. return $this->attributes['billingcycle'];
  59. }
  60. }