mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
32 lines
633 B
PHP
32 lines
633 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
|
|
|
class OldOrders extends Model
|
|
{
|
|
protected $connection = 'old_izyim_db';
|
|
|
|
protected $table = 'orders';
|
|
|
|
/**
|
|
* @return hasOne
|
|
*/
|
|
public function address(): hasOne
|
|
{
|
|
return $this->hasOne(OldAddress::class, 'id', 'address_id')->where('type', '=', 1);
|
|
}
|
|
|
|
/**
|
|
* @return belongsTo
|
|
*/
|
|
public function company(): belongsTo
|
|
{
|
|
return $this->belongsTo(OldCompany::class, 'company_id');
|
|
}
|
|
|
|
}
|