<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class TransactionModel extends Model
{
    protected $table = 'transactions';
    protected $primaryKey = 'txn_id';
    public $incrementing = true;
    public $timestamps = true;

    protected $fillable = [
        'ticket_id',
        'user_id',
        'amount',
        'payment_method',
        'transaction_date',
    ];

    public function ticket()
    {
        return $this->belongsTo(\App\Models\Ticket::class, 'ticket_id', 'ticket_id');
    }
    public function user()
    {
        return $this->belongsTo(\App\Models\User::class, 'user_id', 'user_id');
    }
}
