megacommit

This commit is contained in:
Didier Slof 2023-02-02 08:17:38 +01:00
parent 2451ab45cb
commit 34ed81516b
Signed by: didier
GPG key ID: 01E71F18AA4398E5
51 changed files with 1200 additions and 251 deletions

View file

@ -41,12 +41,17 @@ class Showing extends Model
return $this->belongsTo(Movie::class, 'movie_id', 'movie_id');
}
public function prices()
{
return $this->hasMany(Price::class, 'showing_id', 'showing_id');
}
public function nowPlaying()
{
return $this->where('showing_start', '>=', now())->get();
}
public function end_time() {
public function showing_end() {
$date = new Carbon($this->showing_start);
$date->addMinutes($this->movie->movie_length);
return $date;