Files
exchange-2.0/app/Models/District.php
T
2020-12-28 00:03:14 +08:00

42 lines
877 B
PHP

<?php
namespace App\Models;
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');
}
}