Yes, it is possible to use different verbs for different resources in Laravel. You can achieve this by setting the resource verbs specifically for each resource route definition. Instead of using the global Route::resourceVerbs method, you can define the verbs directly within the Route::resource method for each resource.
Here's how you can do it:
- Define the custom verbs for the
Seedresource. - Define the custom verbs for the
Conversationsresource.
Here is an example:
use Illuminate\Support\Facades\Route;
// Custom verbs for the Seed resource
Route::resource('seeds', 'SeedController')->names([
'create' => 'seeds.condividi',
'edit' => 'seeds.modifica',
]);
// Custom verbs for the Conversations resource
Route::resource('conversations', 'ConversationController')->names([
'create' => 'conversations.crea',
'edit' => 'conversations.modifica',
]);
In this example:
- For the
Seedresource, thecreateverb is changed tocondividiand theeditverb is changed tomodifica. - For the
Conversationsresource, thecreateverb is changed tocreaand theeditverb is changed tomodifica.
This way, you can have different verbs for different resources without affecting the global settings.