You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

HasDefault.php 426B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace App\Traits;
  3. trait HasDefault
  4. {
  5. public function isEnabled(): bool
  6. {
  7. return $this->enabled === true;
  8. }
  9. public function isDisabled(): bool
  10. {
  11. return $this->enabled === false;
  12. }
  13. public static function enabledLabel(): string
  14. {
  15. return translate('Yes');
  16. }
  17. public static function disabledLabel(): string
  18. {
  19. return translate('No');
  20. }
  21. }