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.

1 Answer 1

3

Please try this

{{$home ?? ''}}
Sign up to request clarification or add additional context in comments.

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.