Package

Hapidjus Laravel Impersonate Ui

UI for 404labfr/laravel-impersonate

Package

hapidjus/laravel-impersonate-ui

View on GitHub →

Laravel Impersonate UI

Laravel Impersonate UI is a Laravel Package that adds an easy to use UI for selecting users to impersonate when using https://github.com/404labfr/laravel-impersonate

Requirements

  • Laravel >= 6.1
  • PHP >= 7.1

Installation

  • Require laravel-impersonate-ui with Composer
composer require hapidjus/laravel-impersonate-ui
  • Add the Trait Lab404\Impersonate\Models\Impersonate to your User model.
<?php

namespace App;

use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Lab404\Impersonate\Models\Impersonate;

class User extends Authenticatable
{
    use Notifiable,
        Impersonate;

}

Configuration

To publish the config and blade files use:

php artisan vendor:publish --provider="Hapidjus\ImpersonateUI\ImpersonateUiServiceProvider"

Append --tag=config or --tag=view to only publish config or blade files.

This is the contents of the config file:

return [

	/**
	* Enable Laravel Impersonate UI
	* 
	* Laravel Impersonate UI is enabled by default when in debug 
	* 
	*/
	'enabled' => env('APP_DEBUG',false),

	/**
	* Users allowed to impersonate
	* 
	* Array of user emails, i.e ['admin@example.com'] or null for all
	* 
	*/
	'users_allowed_to_impersonate' => ['admin@example.com'],

	/**
	* Position of icon.
	* 
	* Supported: "bottom-right", "bottom-left", "top-left", "top-right"
	* 
	*/
	'icon_position' => 'bottom-right',

	/**
	* Show Impersonate button. 
	* 
	* Trying to save some clicks?
	* Then this is the option for you! Select a user and BOOM -  
	* form submitted - user impersonated. No need to click any
	* pesky buttons.
	* 
	*/
	'show_button' => true,

	/**
	* Globally include laravel-impersonate-ui. 
	* 
	* Or use this view: @include('impersonate-ui::impersonate-ui')
	* Note: If you choose to include the partials view you need to add
	* a check to test if the current users is allowed 
	* to impersonate
	*/
	'global_include' => true,

	/**
	* The URI/Route to redirect after taking an impersonation.
	*
	* Use 'back' to redirect to the previous page
	*
	*/
	'take_redirect_to' => 'back',

	/**
	* The URI/Route to redirect after leaving an impersonation.
	*
	* Use 'back' to redirect to the previous page
	*
	*/
	'leave_redirect_to' => 'back',

	/**
	* Only allow these users to be impersonated
	*
	* Array of user IDs or null for all
	*
	*/
	'users_only' => null,

	/**
	* Exlude these users from beeing impersonated
	*
	* Array of user IDs or null for none
	*
	*/
	'users_exclude' => null,

];

Partials view:

You can use the partials view to include the Impersonate UI on any pages you want. Note: If you choose to include the partials view you need to add a check to test if the current users is allowed to impersonate

@include('impersonate-ui::impersonate-ui')

Have fun impersonating.

Do not use in production!

Hapidjus Laravel Impersonate Ui Related Articles

Learn how to impersonate users in your Laravel app image

Learn how to impersonate users in your Laravel app

Read article
Login As A Different User Quickly image

Login As A Different User Quickly

Read article
Impersonation in Laravel with the Mirror Package image

Impersonation in Laravel with the Mirror Package

Read article
Build Custom Admin Panels With Backpack for Laravel image

Build Custom Admin Panels With Backpack for Laravel

Read article
Pause All Queues and a New artisan dev UI in Laravel 13.25 image

Pause All Queues and a New artisan dev UI in Laravel 13.25

Read article
Laravel Waterline: UI for Workflows image

Laravel Waterline: UI for Workflows

Read article

Let your users buy domains without leaving your app

If your Laravel app gives users a site, a storefront, or a workspace, they’ll eventually want their own domain. The name.com API lets them search, register, and connect one without leaving your product. It’s a clean REST API, so Laravel’s HTTP client is all you need.

Let your users buy domains without leaving your app

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm

Pushsilver

Pushsilver is simple invoicing for freelancers and small studios — send polished invoices, automate reminders, and get paid on time without the bloat.

Pushsilver

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift