<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class PaymentMethod extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'money',
        'type',
        'corrispettivo_fiscale',
        'enabled',
        'origin_id',
        'destination_id'
    ];

    public function origin()
    {
        return $this->belongsTo(\App\Models\Bank::class, 'origin_id', 'id');
    }

    public function destination()
    {
        return $this->belongsTo(\App\Models\Bank::class, 'destination_id', 'id');
    }
}
