I’m having to move my laravel 5.4 app to a >=PHP 7.3 Server. Upgrading the App to a higher laravel version breaks everything. So I’m stuck with making this work as is. The problem now is that Compact() method (which was used to pass variables to the view is undefined). I’m considering writing a replica of the Compact method in a helper class to make it globally available. Now I can’t even replicate the PHP compact method natively. Please help with any suggestions. Whether on how to fix the issue or with a sample alternative code to the compact method.
Question posted in PHP Versions
You can find a list of all versions here.
You can find a list of all versions here.
2
Answers
you are using an older version of laravel with new version of php.
either you can change your php version to downgrade or you can move to Laravel 5.5
check detail here
You should use
compact()
: