3
I’m doing what I want in a way and I’m looking for alternatives or better ways to do it. I am using Resource Controllers in my application. I am also using softdelete in several models, so my routes are like this:
Route::get('users/deleted', array('uses' => 'UserController@trash'));
Route::put('users/{id}/restore', array('uses' => 'UserController@restore'));
Route::resource('users', 'UserController');
The first route is to display those that have been deleted. The second allows me to restore these deleted elements. The third maps traditional methods (create, Edit, update etc).
What happens is that since I have several controllers that work exactly the same way, I wonder if you have any way to tell the Standard that when I have a Resource Controller, the Restore and Trash methods work in the requests in the above patterns.
Is it possible? Or can you do it better than the one I’m doing?