Download the PHP package eloquent-works/masquerade without Composer

On this page you can find all versions of the php package eloquent-works/masquerade. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package masquerade

๐ŸŽญ Laravel Masquerade

Tests Latest Release

A feature-rich user impersonation package for Laravel.

Laravel Masquerade lets trusted administrators, support agents, and staff safely sign in as another user while preserving the original account, enforcing permission checks, blocking sensitive actions, limiting impersonation duration, and recording a full audit trail.

โœจ Highlights

๐Ÿ“‹ Requirements

Laravel PHP Orchestra Testbench
12.x 8.2+ 10.x
13.x 8.3+ 11.x

๐Ÿ“ฆ Installation

The install command publishes the configuration file, migration, and banner view.

Publish only the configuration file:

Publish only the migration:

Publish only the banner view:

Force republishing package assets:

๐Ÿ‘ค Prepare Your User Model

Add HasMasquerade to the account model that can perform or receive impersonation.

By default, canMasquerade() returns false. This means nobody can masquerade until your application explicitly allows it.

๐ŸŽญ Start Masquerading

You may also provide a specific impersonator and guard:

๐Ÿ›‘ Stop Masquerading

When stopped, Masquerade logs the original user back in and clears the masquerade session state.

๐Ÿ”Ž Inspect the Current Session

Update safe session metadata while troubleshooting:

Extend the active session when a support task legitimately needs more time:

The helper returns the same manager instance:

๐Ÿ›ก๏ธ Protect Routes

Block sensitive actions while masquerading:

Enforce automatic expiration on normal authenticated routes:

Require an active masquerade session:

Share masquerade context on the request for toolbars, macros, and support panels:

๐Ÿงญ Built-In Routes

When routes are enabled, Masquerade registers:

Start from a Blade form:

Stop from a Blade form:

Disable built-in routes if you want to provide your own controller flow:

๐Ÿชช Permissions

Masquerade checks both sides of the impersonation request.

You may disable model permission methods in the config if your application handles authorization elsewhere:

๐Ÿงพ Audit Logs

Every started, ended, and expired masquerade session can be recorded in masquerade_logs.

Each log may include:

Access the actor and target models:

Filter logs with expressive scopes:

โฑ๏ธ Duration Limits

Masquerade can automatically expire old sessions.

Add the duration middleware to routes that should enforce the limit:

You can also check expiration manually:

๐Ÿšซ Sensitive Route Blocking

Use masquerade.block on routes that should never be available while impersonating another account.

Good examples include:

๐Ÿงฉ Blade Directives

Show UI only while masquerading:

Render the included banner:

Or include the published view manually:

๐Ÿ“ก Events

Masquerade dispatches events you can listen for:

Example listener registration:

โš™๏ธ Configuration

Publish the configuration file:

Important options:

๐Ÿงฐ Commands

Examples:

๐Ÿงช Testing Your App Integration

A simple feature test might look like this:

๐Ÿ“ Session Notes

๐ŸŽŸ๏ธ Ticket Context

๐Ÿ›ก๏ธ Ability Blocking

Block sensitive actions while masquerading:

Or use middleware:

๐Ÿ“ค Audit Export

๐Ÿšจ Risk Detection

Enable risk detection in config:

Risk detections are logged with:

๐Ÿ“š Documentation

Full documentation is available in the docs directory:

โœ… Quality Checks

Or run the tools separately:

๐Ÿ” Security

Only allow highly trusted users to masquerade. Always require authorization before starting a session, consider requiring a reason, and block sensitive account, billing, authentication, and destructive routes with masquerade.block.

Masquerade regenerates the session ID when starting and stopping by default. Keep that enabled unless your application has a specific reason to disable it.

๐Ÿค Contributing

See CODE_OF_CONDUCT.md.

๐Ÿ™ Credits

Built by Eloquent Works.

๐Ÿ“„ License

Laravel Masquerade is open-source software licensed under the MIT License.


All versions of masquerade with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/auth Version ^11.15|^12.0|^13.0
illuminate/contracts Version ^11.15|^12.0|^13.0
illuminate/database Version ^11.15|^12.0|^13.0
illuminate/encryption Version ^11.15|^12.0|^13.0
illuminate/http Version ^11.15|^12.0|^13.0
illuminate/routing Version ^11.15|^12.0|^13.0
illuminate/support Version ^11.15|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package eloquent-works/masquerade contains the following files

Loading the files please wait ...