<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Seat extends Model
{
    protected $table = 'seats';
    protected $primaryKey = 'id';
    public $incrementing = true;
    public $timestamps = true;

    protected $fillable = [
        'type',
        'block',
        'number_of_seats',
        'access_gate',
    ];

    public function matches()
    {
        return $this->belongsToMany(MatchModel::class, 'match_seat', 'seat_id', 'match_id')->withPivot('available_tickets');
    }
}
