Error Display: Syntax error, unexpected token "<" When dynamic the page title in laravel

Issue

I am make a page title dynamic if title is set in page then display it otherwise display default title

Here is below code

<title>
@yield({{ 
      @if(isset($title))
        $title
      @else 
        "Islamabad's 1st Digital Real Estate Marketplace | Property051.com"
      @endif
      }})
</title>

@extends('front.layout.app', array('title'=> $get_society->society_name))

Solution

You don’t need yield here, just use:

<title>
@if(isset($title))
   {{ $title }}
@else 
   Islamabad's 1st Digital Real Estate Marketplace | Property051.com
@endif
</title>

Answered By – Marcin NabiaƂek

Answer Checked By – Dawn Plyler (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.