Open ye7iaserag opened 6 years ago
The exact lines are new LineFormatter() new Swift_Message('Laravel Log')
only class names should be used in configurations, example: LineFormatter::class Swift_Message::class
The problem ist that some of these classes need parameters on construct. Do you have an idea how to solve it?
I could think about a solution like:
'message' => [
'class' => Swift_Message::class,
'args' => ['Laravel Log'],
]
This could be used by http://php.net/manual/de/reflectionclass.newinstanceargs.php to get a new instance of the given class including parameters and it is serializable.
Yes that's exactly what was recommended by laravel's config files guidelines
Deserializing big objects from the config files is costly process while bootstrapping the framework, that's why they went against supporting closures in config files
Ok, I will Update it tomorrow and give or a test.
@ye7iaserag it's now in dev-master
- implemented with https://github.com/Astrotomic/laravel-monolog-config/commit/e69fcbc35a7ebd46efd3d5aff80023a6ca6c170b
Would be nice if you can give it a try, before I release it as v2.0
cause it's a breaking change. 😃
Will test is today and update you, but from what i can see that was exactly what was needed Good job :)
@ye7iaserag any update?
The config file needs to be updated to not include any objects use only class names To repeat try the Laravel config:cache command, the generated cached configuration will always throw a fatal error Please update the bundle Thanks