D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
forge
/
developers.ghanempharmacy.com
/
app
/
Models
/
Filename :
DeliveryCity.php
back
Copy
<?php namespace App\Models; use Carbon\Carbon; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; /** * Class DeliveryCity * * @package App\Models * @property int $id * @property int $state_id * @property string $name * @property float $cost * @property int $status * @property Carbon|null $created_at * @property Carbon|null $updated_at */ class DeliveryCity extends Model { use HasFactory; protected $fillable = [ 'state_id', 'name', 'cost', 'status', ]; protected $casts = [ 'id' => 'integer', 'state_id' => 'integer', 'name' => 'string', 'cost' => 'float', 'status' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; public function state(): BelongsTo { return $this->belongsTo(DeliveryState::class, 'state_id'); } public function areas(): HasMany { return $this->hasMany(DeliveryArea::class, 'city_id'); } }