Investigation issue.
If possible, it would be cool to have the SlugHandler try to pick default settings for itself if none are provided.
That is to say if no constructor argument is passed, nor is there any slug_trails config defined on the class it is applied to (or the data model thereof), perhaps it could look up for the settings in the extensions section for what relationship the Slug extension is applied to, and how it manages that. Assumptions would have to be made, or perhaps a default path could be generated? Unsure. Want to be careful of information leakage (e.g. exposing internal names of objects, which probably isn't that sensitive, but should at least be a consideration).
In the very least there should be a 404 thrown if no $slime is found, instead of generating an error:
[Warning] array_key_exists() expects parameter 2 to be array, null given
GET /some-page/some-slug
Line 103 in .../vendor/nightjar/ss-slug/src/SlugHandler.php
Investigation issue.
If possible, it would be cool to have the SlugHandler try to pick default settings for itself if none are provided.
That is to say if no constructor argument is passed, nor is there any slug_trails config defined on the class it is applied to (or the data model thereof), perhaps it could look up for the settings in the
extensionssection for what relationship theSlugextension is applied to, and how it manages that. Assumptions would have to be made, or perhaps a default path could be generated? Unsure. Want to be careful of information leakage (e.g. exposing internal names of objects, which probably isn't that sensitive, but should at least be a consideration).In the very least there should be a 404 thrown if no
$slimeis found, instead of generating an error: