From 86d23a5de27041be2af996fd695b81a997d2ab02 Mon Sep 17 00:00:00 2001 From: David Wheatley Date: Tue, 23 Nov 2021 12:55:36 +0000 Subject: [PATCH] chore: use `@php` in Blade templates (#3172) * chore: remove comment * chore: use `@php` in blade templates * chore: use `@php` in blade templates --- views/frontend/content/discussion.blade.php | 2 +- views/layouts/basic.blade.php | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/views/frontend/content/discussion.blade.php b/views/frontend/content/discussion.blade.php index e9e4ebe13..51a2c9c0c 100644 --- a/views/frontend/content/discussion.blade.php +++ b/views/frontend/content/discussion.blade.php @@ -4,7 +4,7 @@
@foreach ($posts as $post)
- relationships->user->data) ? $getResource($post->relationships->user->data) : null; ?> + @php $user = ! empty($post->relationships->user->data) ? $getResource($post->relationships->user->data) : null; @endphp

{{ $user ? $user->attributes->displayName : $translator->trans('core.lib.username.deleted_text') }}

{!! $post->attributes->contentHtml !!} diff --git a/views/layouts/basic.blade.php b/views/layouts/basic.blade.php index 8e7978ec0..0054dc377 100644 --- a/views/layouts/basic.blade.php +++ b/views/layouts/basic.blade.php @@ -1,9 +1,8 @@ -{{-- TODO: Change below to @php when Laravel is upgraded --}} -get('theme_primary_color', '#000'); -?> +@endphp - +