booking->date, $this->booking->language, 'l j F Y'); $data['data'] = [ 'icon' => '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), // Structured fields for compact notification view 'review_scores' => $this->reviewScores(), 'review_avg' => $this->reviewAvg(), 'customer_name' => $this->booking->name, 'customer_party' => $this->booking->party, 'booking_date_formatted' => $d_formatted, 'booking_time_formatted' => evavel_seconds_to_Hm($this->booking->time), 'customer_email' => $this->booking->email, 'customer_phone' => $this->booking->dial_code . $this->booking->phone, ]; $notification = \Alexr\Models\Notification::create($data); $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 = '
'.$this->booking->name.' (' . $this->booking->party . ')
'; $html .= "'.ReviewItems::conceptForScore($key) . ': ' . ReviewItems::labelForNumber($review->{$key}).'
'; } $html .= '