<?php

namespace Modules\PaymentWay\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Modules\Payment\Models\PaymentDescription;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;

class PaymentWay 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(PaymentWayDescription::class)->where('language_id', currentLanguage()->id);
    }

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