Support the ongoing development of Laravel.io →
posted 9 years ago
Requests
Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

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?

Last updated 2 years ago.
0

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!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.