Use @php instead of {{ when setting title

This commit is contained in:
Christopher C. Wells 2021-03-06 09:31:59 -08:00
parent be681f0dd7
commit 98c961b7d1
3 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
<x-app-layout>
{{ $title = ($food->exists ? "Edit {$food->name}" : 'Add Food') }}
@php($title = ($food->exists ? "Edit {$food->name}" : 'Add Food'))
<x-slot name="title">{{ $title }}</x-slot>
<x-slot name="header">
<h1 class="font-semibold text-xl text-gray-800 leading-tight">{{ $title }}</h1>

View File

@ -1,5 +1,5 @@
<x-app-layout>
{{ $title = ($goal->exists ? 'Edit' : 'Add') . ' Goal' }}
@php($title = ($goal->exists ? 'Edit' : 'Add') . ' Goal')
<x-slot name="title">{{ $title }}</x-slot>
<x-slot name="header">
<h1 class="font-semibold text-xl text-gray-800 leading-tight">{{ $title }}</h1>

View File

@ -1,5 +1,5 @@
<x-app-layout>
{{ $title = ($recipe->exists ? "Edit {$recipe->name}" : 'Add Recipe') }}
@php($title = ($recipe->exists ? "Edit {$recipe->name}" : 'Add Recipe'))
<x-slot name="title">{{ $title }}</x-slot>
<x-slot name="header">
<h1 class="font-semibold text-xl text-gray-800 leading-tight">{{ $title }}</h1>