bakaphp / router

A tool to create multiple Phalcon Collections with easy.
https://bakaphp.github.io/router
MIT License
4 stars 1 forks source link

Add a method to exclude http verbs in a Route #24

Closed gabbanaesteban closed 5 years ago

gabbanaesteban commented 5 years ago

Is your feature request related to a problem? Please describe. I'm always frustrated when I have to create a Route that will use all default HTTP verbs excepting one of them. Basically, you have to re-set the via property with all the HTTP verbs that you want to use when I only want to exclude one of them. Ex: A route that will have get, put, post, patch but not delete

Route::crud('bookinsight-comments')->controller('BookInsightCommentController')->via(Http::GET,Http::POST,Http::PUT),

Describe the solution you'd like A method called notVia in order to determinate what are those vias that the route won't match.

Route::crud('bookinsight-comments')->controller('BookInsightCommentController')->notVia(Http::DELETE),

Describe alternatives you've considered None

Additional context None

gabbanaesteban commented 5 years ago

@DannyFeliz @kaioken what about this?