0

I have been using Resourceful controllers due to its simplicity. like so.

route('branches.create')

But my current business need requires i pass a specific parameter.

current/{company}/branches

how can I create a route to fit that kind of url. I have tried route('current.branches.create') and route('current.' . $id . 'branches.create')

1
  • 1
    Can you show us your routes? as these are just names inside of a helper function route. Commented Sep 8, 2017 at 23:57

1 Answer 1

1

Keep the route as named routes like:

Route::POST('current/{company}/branches', 'SomeController@somemethod')->name('branches.create');

and pass URL like:

<a href="{{route('branches.create', $company->id)}}">GOT TO URL</a>

More about Larvel Named Routes

Hope it's helpful.

Sign up to request clarification or add additional context in comments.

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.