mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
42 lines
870 B
PHP
42 lines
870 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
/**
|
|
* Class District
|
|
* @package App\Models
|
|
* @version August 4, 2020, 4:36 am
|
|
*
|
|
* @property \App\Models\Country country_id
|
|
* @property \App\Models\State state_id
|
|
* @property string name
|
|
* @property text postcode
|
|
*/
|
|
class District extends AbstractModel
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'districts';
|
|
|
|
protected $dates = ['deleted_at'];
|
|
|
|
/**
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
|
**/
|
|
public function country(): HasOne
|
|
{
|
|
return $this->hasOne(Country::class, 'country_id', 'id');
|
|
}
|
|
|
|
/**
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
|
**/
|
|
public function state(): HasOne
|
|
{
|
|
return $this->hasOne(State::class, 'state_id', 'id');
|
|
}
|
|
}
|