<?php

namespace App\Models;

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

class Bank extends Model
{
  use HasFactory;

  protected $table = 'banks';

  protected $fillable = [
        'name',
        'status',
        'type',
        'provider_id',
        'nama_bank',
        'no_rek',
        'nama_penerima',
        // tambahkan atribut lainnya sesuai kebutuhan
    ];

  // Metode untuk mencari bank berdasarkan jenis dan ID penyedia
  public static function findByTypeAndProvider($type, $providerId) {
    return self::where('type', $type)->where('provider_id', $providerId)->get();
  }
}