protected function getAutologinLink(Authenticatable $user, $path = null)
    {
        if ($this->shouldDeleteExpiredTokens()) {
            $this->deleteExpiredTokens();
        }

        // Get the user ID to be associated with a token.
        $userId = $user->getAuthIdentifier();

        // Generate a random unique token that can be used for the link.
        $token = $this->getAutologinToken();

        // Save the token to storage.
        $this->provider->create([
            'user_id'    => $userId,
            'token'      => $token,
            'path'       => $path
        ]);

        // Return a link using the route from the configuration file and
        // the generated token.
        $routeName = config('autologin.route_name');

        return $this->generator->route($routeName, $token);
    }
protected function getAutologinLink(Authenticatable $user, $path = null)
    {
        if ($this->shouldDeleteExpiredTokens()) {
            $this->deleteExpiredTokens();
        }

        // Get the user ID to be associated with a token.
        $userId = $user->getAuthIdentifier();

        // Generate a random unique token that can be used for the link.
        $token = $this->getAutologinToken();

        // Save the token to storage.
        $this->provider->create([
            'user_id'    => $userId,
            'token'      => $token,
            'path'       => $path
        ]);

        // Return a link using the route from the configuration file and
        // the generated token.
        $routeName = config('autologin.route_name');

        return $this->generator->route($routeName, $token);
    }
protected function getAutologinLink ( Authenticatable $ user , $ path = null ) { if ( $ this -> shouldDeleteExpiredTokens ( ) ) { $ this -> deleteExpiredTokens ( ) ; } // Get the user ID to be associated with a token. $ userId = $ user -> getAuthIdentifier ( ) ; // Generate a random unique token that can be used for the link. $ token = $ this -> getAutologinToken ( ) ; // Save the token to storage. $ this -> provider -> create ( [ 'user_id' => $ userId , 'token' => $ token , 'path' => $ path ] ) ; // Return a link using the route from the configuration file and // the generated token. $ routeName = config ( 'autologin.route_name' ) ; return $ this -> generator -> route ( $ routeName , $ token ) ; }
Get the link that can be used to automatically login a user to the
application.

@param  \Illuminate\Contracts\Auth\Authenticatable  $user
@param  string  $path
@return string
Get the link that can be used to automatically login a user to the application .