You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Laravel does not allow closures in config files (this particular one is in the handlebars.php in the config folder). It causes an error when you try run "php artisan cache:config":
$ sudo php artisan config:cache
LogicException
Your configuration files are not serializable.
at vendor/laravel/framework/src/Illuminate/Foundation/Console/ConfigCacheCommand.php:84
80▕ require $configPath;
81▕ } catch (Throwable $e) {
82▕ $this->files->delete($configPath);
83▕
➜ 84▕ throw new LogicException('Your configuration files are not serializable.', 0, $e);
85▕ }
86▕
87▕ $this->components->info('Configuration cached successfully.');
88▕ }
1 bootstrap/cache/config.php:1558
Error::("Call to undefined method Closure::__set_state()")
+14 vendor frames
16 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
The real solution would be to add the "=" and "and" and "or" and "not" operators. Any language should have these. Short of that, there needs to be a way to put functions of some kind other than a closure in the config file, however you think is best so you can put custom functions somewhere. The ideal solution would be to fix both issues for maximum flexibility.
The text was updated successfully, but these errors were encountered:
The PHP Code:
Laravel does not allow closures in config files (this particular one is in the handlebars.php in the config folder). It causes an error when you try run "php artisan cache:config":
The real solution would be to add the "=" and "and" and "or" and "not" operators. Any language should have these. Short of that, there needs to be a way to put functions of some kind other than a closure in the config file, however you think is best so you can put custom functions somewhere. The ideal solution would be to fix both issues for maximum flexibility.
The text was updated successfully, but these errors were encountered: