<?php

namespace Modules\ShippingWay\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Modules\Shipping\Models\ShippingDescription;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;

class ShippingWay extends Model
{
    //use soft delete
    use SoftDeletes;

    protected $fillable = [
        'image'
    ];

    /**
     * Get current description of the the Room
     * @return HasOne
     */
    public function currentDescription() :HasOne
    {
        return $this->hasOne(ShippingWayDescription::class)->where('language_id', currentLanguage()->id);
    }

    public function cities()
    {
        return $this->hasMany(ShippingCity::class);
    }
}
