Initial Commit; base feats
This commit is contained in:
commit
9732135e90
137 changed files with 13856 additions and 0 deletions
39
app/Models/Price.php
Normal file
39
app/Models/Price.php
Normal file
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Price extends Model
|
||||
{
|
||||
|
||||
// Price can differ for Adults, Children, Seniors, etc.
|
||||
// Price can default to a base price, but can be overridden by a specific showing.
|
||||
// When creating a showing, there will be rows for each price type.
|
||||
// If for example a childrens price is manually removed, the ticket will not be available for children. (Handy for special events)
|
||||
|
||||
protected $table = 'prices';
|
||||
protected $primaryKey = 'price_id';
|
||||
protected $fillable = [
|
||||
'price_type', // ENUM: (Adult, Child, Senior, loveseat(2 people))
|
||||
'price_value', // Decimal
|
||||
'showing_id', // which showing is this price for?
|
||||
'user_id', // who added the price?
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function showing()
|
||||
{
|
||||
return $this->belongsTo(Showing::class, 'showing_id', 'showing_id');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id', 'user_id');
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue