<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class ShippingCity extends Model
{
    public $timestamps = false;

    protected $fillable =
        [
            'tax',
            'timing',
            'shipping_id',
            'city_id',
        ];

    public function timingLang($lang)
    {
        $data = json_decode($this->timing);
        $timing = $data->{$lang};
        return $timing;
    }
    public function city()
    {
        return $this->belongsTo(City::class,'city_id')->withTrashed();
    }

}
