4

enter image description here

I want to change the default request url! ex.

GET /photos/{photo}/edit change to /photos/{photo}/update GET /photos/create change to /photos/createOnePhoto

2 Answers 2

6

You can't change default resource() routes. You can tell Laravel to not build some of them by using ->except(['update', 'create']).

Add all custom routes manually:

Route::get('photos/createOnePhoto', ['as' => 'photo.createOne', 'uses' => 'PhotoController@createOnePhoto'])
Sign up to request clarification or add additional context in comments.

1 Comment

Thx, buddy, very helpful!
0

In Laravel 9 you can use Localizing Resource URIs on your App\Providers\RouteServiceProvider.

public function boot()
{
    Route::resourceVerbs([
        'create' => 'crear',
        'edit' => 'editar',
    ]);
 
    // ...
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.