'info', 'booking_id' => $this->booking->id, 'status' => $this->booking->status, 'status_label' => BookingStatus::label($this->booking->status), 'review_id' => $this->booking->review->id, 'title' => $this->title($user), 'text' => $this->text($user), 'feedback' => $this->feedback($user), 'link' => $this->link($user) ]; $notification = \Alexr\Models\Notification::create($data); //Query::setDebug(true); $notification->save(); } protected function title($user) { return __eva('REVIEW'); } public function text($user) { //$d_formatted = Carbon::createFromFormat('Y-m-d', $this->booking->date) // ->locale($this->booking->language) // ->translatedFormat('l j F Y'); $d_formatted = evavel_date_createFromFormatTranslate('Y-m-d', $this->booking->date, $this->booking->language, 'l j F Y'); $html = '
' . $d_formatted . ' - ' . evavel_seconds_to_Hm($this->booking->time).'
'; $html .= '

'.$this->booking->name.' (' . $this->booking->party . ')

'; $html .= "
{$this->booking->email}
"; $html .= "
{$this->booking->dial_code}{$this->booking->phone}
"; $review = $this->booking->review; if ($review) { //$html .= '
'; $html .= '
'; $keys = ['score1', 'score2', 'score3', 'score4', 'score5']; foreach($keys as $key) { $html .= '

'.ReviewItems::conceptForScore($key) . ': ' . ReviewItems::labelForNumber($review->{$key}).'

'; } $html .= '
'; } return $html; } protected function feedback($user) { $review = $this->booking->review; // base64 encoded if ($review) { return $review->feedback; } return ''; } protected function link($user) { return ''; } }