Good day, friends. Help me figure it out, otherwise I’ve already broken my head ... Task - after authorization, on the / login page you need to redirect to the user’s page with id in the URL. An example below.
Now I have registered with LoginController.php:
protected $redirectTo = '/profile'; That is, redirect to the / profile page, but you need to do something like this:
protected $redirectTo = '/profile/{$id}'; That is, the URL of the logged in user is added to the URL.
In routers / web.php I have written this:
Route::get('profile/{id}', 'HomeController@index'); That is, when you go to the / profile / user-id page, a page with information about the user opens with the id specified in the URL. But in LoginController.php it doesn't work like this ... when I write protected $redirectTo = '/profile/{$id}';
then everything works, but only the URL of this type / profile /% 7Bid% 7D
What is wrong doing? I understand that ID is somehow perceived as a string, not a number.