dev-partners / laravel-nova-auditable-log

A Laravel Nova resource tool for visualizing the audit log created by the Laravel Auditing package.
51 stars 22 forks source link

Prohibits route caching #3

Closed ndberg closed 4 years ago

ndberg commented 4 years ago

Prohibits route caching, because it uses route closures.

php artisan route:cache

 LogicException  : Unable to prepare route [nova-vendor/auditable-log/audits/{resourceName}/{resourceId}] for serialization. Uses Closure.

  at /home/vagrant/code/fotogecko/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()
      /home/vagrant/code/fotogecko/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteCacheCommand.php:62

  2   Illuminate\Foundation\Console\RouteCacheCommand::handle()
      /home/vagrant/code/fotogecko/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:32