From cbaa9b9174d92c38f391f4c4032730dbe89e3e3d Mon Sep 17 00:00:00 2001 From: Lukas Halbritter Date: Sun, 9 Sep 2018 09:56:08 +0200 Subject: [PATCH] Added function to get the date of a sub-booking. --- app/SubBooking.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/SubBooking.php b/app/SubBooking.php index f613ee0..041f69f 100644 --- a/app/SubBooking.php +++ b/app/SubBooking.php @@ -6,5 +6,13 @@ use Illuminate\Database\Eloquent\Model; class SubBooking extends Model { - // + /* + * Get the booking date for a sub-booking. + * + * @return string + */ + public function date() + { + return $this->belongsTo('\App\Booking', 'booking_id')->first()->date; + } }