REST isn't really a design pattern, and it's misnamed in Laravel.
You can still use Route resources and then simply add additional routes with Route::get
and Route::post
or whatever.
Good clarification on REST vs. design patterns, machuga. Thanks for that.
I understand that I can add new routes and map them to my non-standard methods of the REST controllers. However, my question is more about best practices. Am I going way off of best practices by doing this? Or is it generally assumed that this will be necessary even in a fairly strict interpretation of REST?
Or is there a more preferred way to implement these non standard methods within the REST controller approach?
I think optimally you could use any "method" you want... regular ones like POST, PUT, etc, and your own actions (ex. "APPROVE", "PUBLISH"). I think, technically, you can do this with the current laravel setup because it puts that action in the _method var on the form. Give it a try!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community