cineflex/app/Models/Ticket.php

36 lines
785 B
PHP
Raw Normal View History

2022-11-23 09:32:34 +01:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Ticket extends Model
{
protected $table = 'tickets';
protected $primaryKey = 'ticket_id';
protected $fillable = [
'order_id', // which order is this ticket for?
'showing_id', // which showing is this ticket for?
'seat_id', // which seat is the ticket for?
'price_id', // which price is this ticket?
'user_id', // who added the ticket?
];
protected $hidden = [
'created_at',
'updated_at',
];
public function order()
{
return $this->belongsTo(Order::class, 'order_id', 'order_id');
}
public function showing()
{
return $this->belongsTo(Showing::class, 'showing_id', 'showing_id');
}
}