I’m currently upgrading some plugins to work with the next LTS version 3.5.
I have a simple comments plugin that uses the restful API. However, I found no way to create an API handler
One major change is that the constructor method for the APIHandler class now needs a controller of type PKPBaseController (I guess it is the Illuminate\Routing\Controller). But the hook I used so far (Dispatcher::dispatch) only provides a response object
Hi @felixhelix , with the removal of slim framework and porting of all the API routes to laravel’s routing toolset, we haven’t introduced any functionality yet that allow plugins to add or override existing routes . Previously we have a hook APIHandler::endpoints that allow plugin to add new route but it has been removed as previous mechanism is not compatible with current implementation .
If you think there is some good use case of this feature, may be create a new feature request from https://forum.pkp.sfu.ca/c/feature-requests/8 and with enough support, we can merge the above proof of concept into the core . In the mean time I will discuss about it with other team member to see what their opinion on this .
Thanks for you reply!
I added a feature request as suggested:
I hope that underscores the neccessity of such a feature. With the integration of vue.js I think it will become even more important to have such an option.