|
- <?php
-
- namespace App\Models;
-
- use Illuminate\Support\Str;
-
- class Contract extends AppModel
- {
-
- const COL_NAME_NAME = 'name';
- const COL_NAME_CUSTOM = 'custom';
-
- public function getModelName(): string
- {
- return "契約";
- }
-
- public function includeCustom(string $target): bool
- {
- return in_array($target, $this->custom(), true);
- }
-
- public function custom(): array
- {
- $custom = data_get($this, self::COL_NAME_CUSTOM);
- if ($custom) {
- return explode(',', $custom);
- } else {
- return [];
- }
- }
- }
|