Opis\Closure\SerializableClosure - Error afer PHP 8.1 Update

Viewed 6002

I have updated my system to PHP 8.1 (XAMPP). Now I have the problem that when I enter the command "php artisan serve" I get the following error message:

Opis\Closure\SerializableClosure implements the Serializable interface, which is deprecated.
 Implement __serialize() and __unserialize() instead 
(or in addition, if support for old PHP versions is necessary).

Can you help me what I can do to make it work again?

3 Answers

You need to update laravel dependencies. Simply go to your project root directory and use composer to update dependencies using command prompt.

Command should be:

composer update

Just delete composer.lock.json, with me resolve and after run composer install

composer upgrade laravel/framework --with-all-dependencies

You would need to update laravel/framework with it's dependencies. Instead of running composer upgrade which upgrades all packages, you could just run composer upgrade laravel/framework --with-all-dependencies, shorthand is -W.

From the composer command help -W Update also dependencies of packages in the argument list, including those which are root requirements.

Related