<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;

class Withdraw extends BaseModel
{

    protected $table = 'withdraws';
    protected $fillable = ['member_id', 'amount', 'service_charge', 'to_account', 'address', 'exchange_rate', 'status', 'after_balance', 'remark', 'admin_note', 'is_locked'];
    protected $hidden = [];

    public function member(): BelongsTo
    {
        return $this->belongsTo(User::class, 'member_id', 'member_id')
            ->select(['id', 'member_id', 'username', 'first_name', 'admin_note', 'status', 'phone', 'visitor_id', 'register_ip']);
    }
}