TldCategoryPivot.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace ModulesGarden\ProxmoxAddon\Core\Models\Whmcs;
  3. use \Illuminate\Database\Eloquent\Model as EloquentModel;
  4. /**
  5. * Description of TldCategoryPivot
  6. *
  7. * @author Paweł Złamaniec <pawel.zl@modulesgarden.com>
  8. */
  9. class TldCategoryPivot extends EloquentModel
  10. {
  11. /**
  12. * Table name
  13. *
  14. * @var string
  15. */
  16. protected $table = 'tbltld_category_pivot';
  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 = ['tld_id', 'category_id'];
  28. /**
  29. * Indicates if the model should soft delete.
  30. *
  31. * @var bool
  32. */
  33. protected $softDelete = false;
  34. /**
  35. * Indicates if the model should be timestamped.
  36. *
  37. * @var bool
  38. */
  39. public $timestamps = true;
  40. public function __construct(array $attributes = [])
  41. {
  42. parent::__construct($attributes);
  43. }
  44. public function tld()
  45. {
  46. return $this->hasOne('ModulesGarden\ProxmoxAddon\Core\Models\Whmcs\Tld', 'tld_id');
  47. }
  48. public function category()
  49. {
  50. return $this->hasOne('ModulesGarden\ProxmoxAddon\Core\Models\Whmcs\TldCategory', 'tld_id');
  51. }
  52. }