Skip to content
Advertisement

Can I enter from admin to an authenticated user dashboard?

I am working in a project in laravel with livewire. I am working in the admin dashboard that has all user data in a simple table. In this table, I have been requested that when I click on user name, I have to be sent to the specified user dashboard that has been created with livewire. The problem is that users are authenticated and I cant find a way to get there.

client-list blade

JavaScript

And web.php:

Route::get('/dashboard/{user}','AppHttpControllersDashboardController@index')->name('dashboard-admin');

Advertisement

Answer

You can use the loginUsingId() in your controller for login into the user dashboard:

https://laravel.com/docs/8.x/authentication#authenticate-a-user-by-id

On your DashboardController:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement