領収証発行サービス
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.

33 line
597B

  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Support\Str;
  4. class Contract extends AppModel
  5. {
  6. const COL_NAME_NAME = 'name';
  7. const COL_NAME_CUSTOM = 'custom';
  8. public function getModelName(): string
  9. {
  10. return "契約";
  11. }
  12. public function includeCustom(string $target): bool
  13. {
  14. return in_array($target, $this->custom(), true);
  15. }
  16. public function custom(): array
  17. {
  18. $custom = data_get($this, self::COL_NAME_CUSTOM);
  19. if ($custom) {
  20. return explode(',', $custom);
  21. } else {
  22. return [];
  23. }
  24. }
  25. }