S
S
suhuxa12017-08-04 13:29:51
Laravel
suhuxa1, 2017-08-04 13:29:51

Why can't alias be used in laravel for internal redirects or view return?

Hey!
I have a bunch of routes, each has its own alias. Actually in the view, I easily use route('name') to quickly insert a specific link. But is it possible to somehow use such a life hack in the program code? It is very inconvenient to write in the admin panel, for example, after editing an article, return to the article menu, like: Well, in the example, the link contains only 2 words, there are links with 4-5 words. I would like to use an alias in such a case, so that it would be like: Alas, this does not work (Is this not provided for in the lara?
return redirect('/admin/posts')
return redirect('all_posts')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
cha-cha, 2017-08-04
@suhuxa1

return redirect()->route('all_posts');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question