Support the ongoing development of Laravel.io →
posted 5 years ago
Last updated 2 years ago.
0

Run

php artisan cache:clear
php artisan route:cache

on prod server

0

thanks for your answer: cache:clear was ok, but route:cache gives me

Route cache cleared!

   LogicException  : Unable to prepare route [api/user] for serialization. Uses Closure.

  at /var/www/intranet/vendor/laravel/framework/src/Illuminate/Routing/Route.php:917
    913|      */
    914|     public function prepareForSerialization()
    915|     {
    916|         if ($this->action['uses'] instanceof Closure) {
  > 917|             throw new LogicException("Unable to prepare route [{$this->uri}] for serialization. Uses Closure.");
    918|         }
    919|
    920|         $this->compileRoute();
    921|

  Exception trace:

  1   Illuminate\Routing\Route::prepareForSerialization()
      /var/www/intranet/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteCacheCommand.php:62

  2   Illuminate\Foundation\Console\RouteCacheCommand::handle()
      /var/www/intranet/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:32

  Please use the argument -v to see more details.

and the problem is still there. thanks

0

this is a bug in Laravel from what I know. If you are not using routes in api.php... just delete all routes in api.php file

and try again

Last updated 5 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

andrea giorg Joined 13 Sep 2018

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.