*/ public static function messageKeys(): array { return self::MESSAGE_KEYS; } protected function category(): string { return self::CATEGORY_ENGAGEMENT; } protected function payload(object $notifiable): array { $message = $this->message(); return [ 'type' => 'engagement_reminder', 'title' => $message['title'], 'body' => $message['body'], 'url' => MobileDeepLink::to($this->path()), 'data' => [ 'message_key' => $this->messageKey, ], ]; } /** * @return array{title: string, body: string} */ private function message(): array { $message = trans("api.notifications.engagement_reminders.{$this->messageKey}"); if (is_array($message)) { return $message; } $fallback = trans('api.notifications.engagement_reminders.publish_meal'); return is_array($fallback) ? $fallback : [ 'title' => 'Bowli', 'body' => 'Publie ton plat du jour quand tu as un moment.', ]; } private function path(): string { return $this->messageKey === 'workout_checkin' ? 'profile/workouts?create=1' : 'create'; } }