Laravel-Admin icon indicating copy to clipboard operation
Laravel-Admin copied to clipboard

var_export does not handle circular references

Open prathna124 opened this issue 2 years ago • 1 comments
trafficstars

Laravel: 8 Php: 8.1

We are facing an issue when caching the config with PHP artisan config: cache. It is a circular references-related issue and we have also faced issue-related closure that occurs when using the callback function in config files as you have suggested here https://github.com/exodusanto/Laravel-Admin/blob/master/docs/fields.md#editable-option.

https://i.imgur.com/Fxcb7Pt.png Error: var_export does not handle circular references

We have tried this but not working:-

  • We have tried to handle the error using Handler.php but it is not working
  • Also we have tried to remove the closure function from config/adminer.php but we have faced the below error: There are problems with your administrator.php config: The permission option must be a function

Please guide me on how to solve this error when configuring the cache.

Is it possible to ignore this error when config cache or any way to handle this so error should not be reported? Please guide me how to solve this ?

prathna124 avatar Nov 07 '23 05:11 prathna124

I'm worried that closures are not allowed in Laravel, I'm facing this error many times but there was an issue where they confirm that closures are unsupported for serialization.

In the issue someone suggested a way to serialize closures but I suppose that the PR was never be created.

If you want to use closures you can't use config:cache command...

exodusanto avatar Nov 07 '23 07:11 exodusanto