https://github.com/matthewbdaly/laravel-impersonator
Impersonate other users to assist in resolving issues
https://github.com/matthewbdaly/laravel-impersonator
impersonator laravel laravel-5-package php
Last synced: 3 months ago
JSON representation
Impersonate other users to assist in resolving issues
- Host: GitHub
- URL: https://github.com/matthewbdaly/laravel-impersonator
- Owner: matthewbdaly
- License: mit
- Created: 2017-11-17T09:46:44.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-19T13:38:27.000Z (over 7 years ago)
- Last Synced: 2024-04-14T04:02:29.369Z (about 1 year ago)
- Topics: impersonator, laravel, laravel-5-package, php
- Language: PHP
- Size: 16.6 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# laravel-impersonator
[](https://travis-ci.org/matthewbdaly/laravel-impersonator)
[](https://coveralls.io/github/matthewbdaly/laravel-impersonator?branch=master)Impersonate other users to assist in resolving issues
Installation
------------Run the following command to install the package:
```bash
composer require matthewbdaly/laravel-impersonator
```Then just include this in your `app/Http/Kernel.php` in the appropriate place where you want to import the middleware:
```php
\Matthewbdaly\LaravelImpersonator\Http\Middleware\Impersonator::class
```You can apply it globally, or only to specific routes as you wish. You will also need to add the trait `Matthewbdaly\LaravelImpersonator\Eloquent\Traits\CanImpersonate` to your user model to add these methods:
* `startImpersonating($id)` - start impersonating user `$id`
* `stopImpersonating()` - stop impersonating
* `isImpersonating()` - Is user impersonating or not?