mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
52 lines
994 B
PHP
52 lines
994 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
/**
|
|
* Class District
|
|
* @package App\Models
|
|
*
|
|
* @property int $country_id
|
|
* @property int $state_id
|
|
* @property string $name
|
|
* @property string $postcode
|
|
*/
|
|
class District extends AbstractModel
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'districts';
|
|
|
|
/**
|
|
* Get the attributes that should be cast.
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'deleted_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return BelongsTo
|
|
*/
|
|
public function country(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Country::class, 'country_id', 'id');
|
|
}
|
|
|
|
/**
|
|
* @return BelongsTo
|
|
**/
|
|
public function state(): BelongsTo
|
|
{
|
|
return $this->BelongsTo(State::class, 'state_id', 'id');
|
|
}
|
|
}
|