2020-04-12 00:26:44 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App;
|
|
|
|
|
2024-09-22 17:32:29 +02:00
|
|
|
use Database\Factories\RegionFactory;
|
2023-02-17 18:57:11 +01:00
|
|
|
use Illuminate\Support\Collection;
|
2022-08-12 22:07:59 +02:00
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
2020-04-12 00:26:44 +02:00
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
class Region extends Model
|
|
|
|
{
|
2024-09-22 17:32:29 +02:00
|
|
|
/** @use HasFactory<RegionFactory> */
|
2022-08-12 22:07:59 +02:00
|
|
|
use HasFactory;
|
2020-04-12 00:26:44 +02:00
|
|
|
public $timestamps = false;
|
|
|
|
|
|
|
|
public $fillable = ['name', 'nami_id', 'is_null'];
|
|
|
|
|
|
|
|
public $casts = [
|
2022-03-11 20:19:17 +01:00
|
|
|
'is_null' => 'boolean',
|
2020-04-12 00:26:44 +02:00
|
|
|
];
|
2022-03-20 12:20:01 +01:00
|
|
|
|
2023-02-17 18:57:11 +01:00
|
|
|
/**
|
|
|
|
* @return Collection<int, array{id: int, name: string}>
|
|
|
|
*/
|
2022-03-20 12:20:01 +01:00
|
|
|
public static function forSelect(): Collection
|
|
|
|
{
|
|
|
|
return static::select('id', 'name')->get();
|
|
|
|
}
|
2020-04-12 00:26:44 +02:00
|
|
|
}
|