0

Named routes, the best thing that's created by Laravel. But is it's possible in some way to add an array of named routes which can be used?

I did the follow:

Route::get('/', [
    'as' => ['url', 'secondurl'],
    'uses' => 'ViewController@index'
]);

but it returned an eror, Illegal offset type.

Is this simply not possible or did I do something wrong?

2
  • What problem are you trying to solve by having a route with 2 names? There is probably just a different approach that would accomplish something similar Commented Aug 26, 2016 at 10:41
  • @RobFonseca someone declared the named route 2 time and he assinged it already in almost every file... Commented Aug 26, 2016 at 11:01

1 Answer 1

2

As far as I know, you can only set one name for each of the route. Check the documentations here.

Hope my answer helps =)

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

1 Comment

Yes, I looked at the documentation but that's why I asked it here. But unfortunately it's not possible.

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.