Answer the question
In order to leave comments, you need to log in
How to pass list of routes from server to client?
The situation is as follows - I am writing a site on laravel and react + redux. I really hate to duplicate things on both sides and so the question arose - is there a normal way to pass a list of routes for a page being loaded? I understand that for compound paths you need some library that will replace parameters by mask, so the question should rather sound like this - do you use any libraries to figure out routes from the server to the client? This may not necessarily be laravel, but, say, rails or Django. Or do frontenders duplicate all paths?
Answer the question
In order to leave comments, you need to log in
$routeCollection = Route::getRoutes();
foreach ($routeCollection as $value) {
echo $value->getPath();
}
Route::getByName()
Route::getByAction()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question