0

I have a blade master view in Laravel which contains the code {{$home or ''}}. My server is using PHP 7.1, Nginx. I migrated the code to another server with cPanel, just copied the whole contents and database and setup everything. The server to which I migrated the code runs Litespeed and Php 7.3. The same code works on server running nginx but not the newly migrated server. When I browse the page, I get Undefined variable: home. How can it run on nginx and not when using Litespeed. I'm new to litespeed and I haven't configured anything specific to laravel. Can someone please help to get this working.

Edit 1: based on this, this syntax doesn't work on Laravel 5.7 and above but I'm using 5.8 and it works fine at the moment on old server.

subzero355
  • 87
  • 1
  • 8

1 Answers1

3

Please try this

{{$home ?? ''}}
Tirdad Abbasi
  • 707
  • 5
  • 17
  • This works, I'm however not able to understand this behavior. Why does it work on PHP7.1+Nginx while not on PHP7.1+Litespeed – subzero355 Jul 27 '20 at 03:43