I need to add an additional method (POST search) to the routes that are added as a resource, can someone guide me on how I can achieve it?
In the routes.php file I have the following code:
Route::resources([
'/user' => App\Http\Controllers\UserTC::class,
'/role' => App\Http\Controllers\RoleTC::class,
...
]);
Somehow I want the search method to be used when setting route::resources such as index, show, store, etc.
Thanks
Edit 1: What I'm looking for is to prevent doing this:
Route::post('/user/search', [App\Http\Controllers\UserTC::class, 'search']);
Route::post('/role/search', [App\Http\Controllers\RoleTC::class, 'search']);
...etc