From d7c531e1c7d4fb2d1340abce56c92c5ce5c3d87b Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Wed, 29 Mar 2023 10:33:15 -0600 Subject: [PATCH 1/2] Checks if user variable exist before using its properties --- resources/views/account/accept/index.blade.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/views/account/accept/index.blade.php b/resources/views/account/accept/index.blade.php index f97c6c564..9f11bdfa7 100755 --- a/resources/views/account/accept/index.blade.php +++ b/resources/views/account/accept/index.blade.php @@ -1,8 +1,11 @@ @extends('layouts/default') +@php + !empty($user) ? $full_name = $user->present()->full_name : $full_name = ''; +@endphp {{-- Page title --}} @section('title') -{{ trans('general.accept_assets', array('name' => $user->present()->fullName())) }} +{{ trans('general.accept_assets', array('name' => $full_name)) }} @parent @stop From d622dbb9434bae2b599781cac68161c8864a3907 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Wed, 29 Mar 2023 18:37:47 -0600 Subject: [PATCH 2/2] Revert the php codeblock and replace it with a ternary --- resources/views/account/accept/index.blade.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/resources/views/account/accept/index.blade.php b/resources/views/account/accept/index.blade.php index 9f11bdfa7..f2a9bc56f 100755 --- a/resources/views/account/accept/index.blade.php +++ b/resources/views/account/accept/index.blade.php @@ -1,11 +1,8 @@ @extends('layouts/default') -@php - !empty($user) ? $full_name = $user->present()->full_name : $full_name = ''; -@endphp {{-- Page title --}} @section('title') -{{ trans('general.accept_assets', array('name' => $full_name)) }} +{{ trans('general.accept_assets', array('name' => empty($user) ? '' : $user->present()->full_name)) }} @parent @stop