RonasIT / laravel-media

0 stars 0 forks source link

Ability to register package routes in required place of the app #24

Open DenTray opened 4 weeks ago

DenTray commented 4 weeks ago

At the moment all package endpoints are registering automatically after package installation.

It good, but we can't wrap it into middlewares or modify prefixes.

Good solution to resolve it - will be implement some kind of helper which will register routes in required place.

As a reference - we can implement the same logic as Laravel providing in Auth::routes() method.

It also will be very helpful if the package will automatically determine whether he should register routes automatically (if a helper didn't call) or not.

RGO230 commented 2 weeks ago

@DenTray, done please check

DenTray commented 1 week ago

@RGO230 not works correctly for me

I've registered routes in my guest group

image

Package routes stopping works for the default paths

image

But it now works for my path (actually I've set only delete endpoint type)

image

I've also imagine that it would be better to use Enum for setting routes type as we can use type hints in this case

image