<?php

namespace App\Models;

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


class Card extends Model
{
    use HasFactory;
   

    protected $fillable = [
        'user_id',
        'card_number',
        'card_exp_number',
        'card_cvv',
        'card_type',
        'card_status',
    ];

    // Define relationship with User
    public function user()
    {
        return $this->belongsTo(User::class);
    }
    
    public function scopePending($query)
    {
        return $query->where('card_status', 2);
    }
}