| 1 | <?php |
||
| 11 | class Country extends ChocolateyModel |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Disable Timestamps |
||
| 15 | * |
||
| 16 | * @var bool |
||
| 17 | */ |
||
| 18 | public $timestamps = false; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * The table associated with the model. |
||
| 22 | * |
||
| 23 | * @var string |
||
| 24 | */ |
||
| 25 | protected $table = 'chocolatey_shop_countries'; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * The Appender(s) of the Model |
||
| 29 | * |
||
| 30 | * @var array |
||
| 31 | */ |
||
| 32 | protected $appends = [ |
||
| 33 | 'uniqueId' |
||
| 34 | ]; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Primary Key of the Table |
||
| 38 | * |
||
| 39 | * @var string |
||
| 40 | */ |
||
| 41 | protected $primaryKey = 'id'; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Store an Shop Country |
||
| 45 | * @param string $countryCode |
||
| 46 | * @param string $name |
||
| 47 | * @return Country |
||
| 48 | */ |
||
| 49 | public function store(string $countryCode, string $name): Country |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Get Unique Id |
||
| 59 | * |
||
| 60 | * @return int |
||
| 61 | */ |
||
| 62 | public function getUniqueIdAttribute(): int |
||
| 66 | } |
||
| 67 |