<?php

namespace App\Models;

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

class Withdrawal extends Model
{
    use HasFactory;
    protected $table = "withdrawal";
    protected $fillable = [
        'user_id',
        'amount',
        'bank_id',
        'status'
    ];

    public function bank()
    {
        return $this->hasOne(BankDetail::class, 'id', 'bank_id');
    }

    public function user()
    {
        return $this->belongsTo(User::class);
    }
}
