php - Getting "Undefined variable" AFTER deploying Laravel app on ubuntu16.04

749

In my app, I have similar to this

@extends('layout.master')

<?
$user = auth()->user();
$specialities_store_granted     = $user->can('specialities.store');
?>

@section('top-buttons')
    @if ($specialities_store_granted)
        //.....
    @endif
@stop  

code on each page which works fine on my local machine. However, after deploying on Ubuntu I get an error on each page similar to this

   Undefined variable: specialities_store_granted (View: 
/var/www/....com/resources/views/specialities/specialities.blade.php)

What it may be?

343

Answer

Solution:

Change<? to<?php.

There is a PHP setting allow<? but that is turned off in your PHP installation.

Note also that this legacy feature will be deprecated and removed. It only still exists to support really old code. Don't use it.

People are also looking for solutions to the problem: php - Phpmyadmin login page Issue

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.