mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim.git
synced 2026-08-19 20:44:03 +00:00
28 lines
732 B
PHP
28 lines
732 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
class AddressBook extends AbstractModel
|
|
{
|
|
protected $table = 'address_book';
|
|
|
|
protected $fillable = [
|
|
'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', 'id', 'reference_id')->where('type', '=', 1);
|
|
}
|
|
|
|
public function warehouse()
|
|
{
|
|
return $this->belongsTo('App\Models\Warehouse', 'id', 'reference_id')->where('type', '=', 2);
|
|
}
|
|
}
|