PHP code example of pinetco-dev / laravel-impersonate

1. Go to this page and download the library: Download pinetco-dev/laravel-impersonate library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pinetco-dev / laravel-impersonate example snippets


Router::get('/payment', function() {
    echo "This page cannot be accessed by an impersonator.";
})->middleware('impersonate.protect');

@canImpersonate
    <a href="{{ route('impersonate', $user) }}">Login as {{ $user->name }}</a>
@endCanImpersonate

@impersonating
    <a href="{{ route('impersonate.leave', ['impersonate' => get_impersonate_session_value()]) }}">
        Leave impersonation mode
    </a>
@endImpersonating
bash
php artisan vendor:publish --tag="impersonate-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="impersonate-config"