mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-19 12:34:01 +00:00
33 lines
591 B
PHP
33 lines
591 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
|
|
class OldCompany extends Model
|
|
{
|
|
protected $connection = 'old_izyim_db';
|
|
|
|
protected $table = 'companies';
|
|
|
|
/**
|
|
* @return hasMany
|
|
*/
|
|
public function addresses(): hasMany
|
|
{
|
|
return $this->hasMany(OldAddress::class, 'reference_id', 'id')->where('type', '=', 1);
|
|
}
|
|
|
|
/**
|
|
* @return hasMany
|
|
*/
|
|
public function orders(): hasMany
|
|
{
|
|
return $this->hasMany(OldOrders::class, 'company_id', 'id');
|
|
}
|
|
|
|
}
|