$cities * @property-read int|null $cities_count * @property-read \Illuminate\Database\Eloquent\Collection $states * @property-read int|null $states_count * @method static \Illuminate\Database\Eloquent\Builder|Country newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|Country newQuery() * @method static \Illuminate\Database\Eloquent\Builder|Country onlyTrashed() * @method static \Illuminate\Database\Eloquent\Builder|Country query() * @method static \Illuminate\Database\Eloquent\Builder|Country whereCode($value) * @method static \Illuminate\Database\Eloquent\Builder|Country whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Country whereDeletedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Country whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|Country whereName($value) * @method static \Illuminate\Database\Eloquent\Builder|Country whereStatus($value) * @method static \Illuminate\Database\Eloquent\Builder|Country whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Country withTrashed(bool $withTrashed = true) * @method static \Illuminate\Database\Eloquent\Builder|Country withoutTrashed() * @mixin \Eloquent */ class Country extends Model { use HasFactory, SoftDeletes; protected $table = 'countries'; protected $guarded = ['id']; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'status' => DefaultStatusEnum::class, ]; } /** * @return HasMany */ public function states(): HasMany { return $this->hasMany(State::class, 'country_id'); } /** * @return HasMany */ public function cities(): HasMany { return $this->hasMany(City::class, 'country_id'); } }