$this->detail, 'activity_creator' => $this->user, ]; } /** * Build the common reason footer line used in mail messages. */ protected function buildReasonFooterLine(LocaleDefinition $locale): LinkedMailMessageLine { return new LinkedMailMessageLine( url('/preferences/notifications'), $locale->trans('notifications.footer_reason'), $locale->trans('notifications.footer_reason_link'), ); } /** * Build a line which provides the book > chapter path to a page. * Takes into account visibility of these parent items. * Returns null if no path items can be used. */ protected function buildPagePathLine(Page $page, User $notifiable): ?EntityPathMessageLine { $permissions = new PermissionApplicator($notifiable); $path = array_filter([$page->book, $page->chapter], function (?Entity $entity) use ($permissions) { return !is_null($entity) && $permissions->checkOwnableUserAccess($entity, 'view'); }); return empty($path) ? null : new EntityPathMessageLine($path); } }