'boolean', 'whatsapp_sent' => 'boolean', //'date_created' => 'datetime', //'date_modified' => 'datetime', ]; public function restaurant() { return $this->belongsTo(Restaurant::class); } public function booking() { return $this->belongsTo(Booking::class); } /** * Check if a booking was created from this missed call * * @return bool */ public function hasBooking() { return !empty($this->booking_id); } /** * Link a booking to this missed call log * * @param int $bookingId * @return bool */ public function linkBooking($bookingId) { $this->booking_id = $bookingId; return $this->save(); } }