Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.
/ nova-login-as Public archive

🚪 An easy way to login as any user from Laravel Nova

License

Notifications You must be signed in to change notification settings

coderello/nova-login-as

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nova Login As

Nova Login As provides an easy way to login as any user from Laravel Nova.

Install

You can install this package via composer using this command:

composer require coderello/nova-login-as

Usage

The only thing you need to do in order to make it work after the installation is to add LoginAs action to the User Nova resource.

public function actions(Request $request)
{
    return [
        new \Coderello\LoginAs\Actions\LoginAs,
    ];
}

Now you can run LoginAs action on the needed user after which you will be redirected to the home page of the website being authenticated as needed user.

Redirection direction

By default you'll be redirected to the home route if it exists or the / if not.

If you want, you are free to customize the redirection direction by passing the Closure with your logic to the ->redirectTo() method.

public function actions(Request $request)
{
    return [
        (new \Coderello\LoginAs\Actions\LoginAs)
            ->redirectTo(function ($user) {
                return route('profile', $user);
            }),
    ];
}

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.

About

🚪 An easy way to login as any user from Laravel Nova

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages