<?php

namespace App\Models;

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

class ShopPayment extends Model
{
    /** @use HasFactory<\Database\Factories\ShopPaymentFactory> */
    use HasFactory;

    protected $table = 'shop_payments';

    protected $fillable = [
        'shop_user_id',
        'amount',
        'status',
        'payment_method',
        'plan_type',
        'reference',
        'date',
    ];

    protected function casts(): array
    {
        return [
            'date' => 'date',
        ];
    }

    public function shopUser(): BelongsTo
    {
        return $this->belongsTo(ShopUser::class);
    }
}
