Please show on what line and in what file the error occured.
And on the server, make a file in /public called phpinfo.php and paste this into it. Then call it in the browser
<?php
phpinfo();
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi guys, im really confused on this error
syntax error, unexpected 'SlugOptions' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
about spatie/laravel-sluggable package. I did some couple of research and some people stated is to check the composer and php version which in my case I have the 7.4 version. This error only occurs on my dev server but it works perfectly on my local development environment and both have the same version of every packages.
composer.json
"require": {
"php": "^7.4",
"ext-curl": "*",
"ext-json": "*",
"darkaonline/l5-swagger": "^7.0",
"doctrine/dbal": "^2.10",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.5",
"laravel/framework": "^7.0",
"laravel/passport": "^9.2",
"laravel/socialite": "^5.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^2.0",
"laravolt/avatar": "^3.2",
"socialiteproviders/facebook": "^1.0",
"spatie/laravel-sluggable": "^2.5"
},
My local php version
PHP 7.4.8 (cli) (built: Jul 9 2020 11:30:39) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
Server php version
PHP 7.4.10 (cli) (built: Sep 9 2020 06:36:14) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
Please or to participate in this conversation.