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