mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 12:34:18 +00:00
42 lines
834 B
PHP
42 lines
834 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 \App\Models\Country country_id
|
|
* @property \App\Models\State state_id
|
|
* @property string name
|
|
* @property string postcode
|
|
*/
|
|
class District extends AbstractModel
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'districts';
|
|
|
|
protected $dates = ['deleted_at'];
|
|
|
|
/**
|
|
* @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');
|
|
}
|
|
}
|