mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim.git
synced 2026-09-01 10:53:58 +00:00
large commit
This commit is contained in:
@@ -7,11 +7,21 @@ class AddressBook extends AbstractModel
|
||||
protected $table = 'address_book';
|
||||
|
||||
protected $fillable = [
|
||||
'company_id', 'reference', 'contact', 'street_one', 'street_two', 'city', 'state', 'post_code', 'country', 'default', 'billing'
|
||||
'type', 'reference_id', 'reference', 'contact', 'street_one', 'street_two', 'city', 'state', 'post_code', 'country', 'default', 'billing'
|
||||
];
|
||||
|
||||
public function forwarder()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Forwarder', 'id', 'reference_id')->where('type', '=', 0);
|
||||
}
|
||||
|
||||
public function company()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Company');
|
||||
return $this->belongsTo('App\Models\Company', 'id', 'reference_id')->where('type', '=', 1);
|
||||
}
|
||||
|
||||
public function warehouse()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Warehouse', 'id', 'reference_id')->where('type', '=', 2);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user