M
M
MiJunior2018-11-01 11:57:25
Laravel
MiJunior, 2018-11-01 11:57:25

How to get the name of the previous route?

Interested not in URL::previous()
but in Route name

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin B., 2018-11-01
@Kostik_1993

I did it

$back_route = app('router')->getRoutes()->match(app('request')->create(redirect()->back()->getTargetUrl()));
$back_route_name = $back_route->getName();
$back_route_params = $back_route->parameters();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question