<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class StoreOld extends Model
{
    protected $connection = 'mysql2';
    protected $table = 'stores';

    public function station() {
        return $this->belongsTo(LocationOld::class, 'station_id', 'id');
    }

    public function location() {
        return $this->belongsTo(LocationOld::class, 'location_id', 'id')->with('parent');
    }

    public function brand_detail() {
        return $this->hasMany(BrandDetailOld::class, 'store_id', 'id')->with('brand');
    }
}
