<?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');
    }

}
