StydeNet / enlighten

Enlighten your APIs with auto-generated documentation
MIT License
575 stars 32 forks source link

404 When trying to load Documentation #60

Open Drewdan opened 3 years ago

Drewdan commented 3 years ago

Describe the bug

Not 100% sure this is a bug, more of a question. The package has routes which rely on the group for model route binding, however, in our application, we have a Route::bind on group which causes this to fail, and we get a 404 instead as it's binding to the wrong model.

To Reproduce

Steps to reproduce the behavior: Bind the group name to another model in the RouteServiceProvider:

        Route::bind(
            'group',
            static function ($id) {
                return Group::with(['users'])->findOrFail($id);
            },
        );

Try to load some documentation, and you will get a 404

Expected behavior

Ideally, the documentation would still load, but this binding will override this.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context

I am wondering if it would be a consideration of this package, to use a less common word instead of group, like docGroup to help prevent collisions like this, or if this would be something that you would think should be up to the person implementing this package to overcome?