Download the PHP package alexssander-cusin/panic-control-laravel without Composer
On this page you can find all versions of the php package alexssander-cusin/panic-control-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alexssander-cusin/panic-control-laravel
More information about alexssander-cusin/panic-control-laravel
Files in alexssander-cusin/panic-control-laravel
Package panic-control-laravel
Short Description This is my package panic-control-laravel
License MIT
Homepage https://github.com/alexssander-cusin/panic-control-laravel
Informations about the package panic-control-laravel
Panic Control for Laravel
Installation
You can install the package via composer:
You can publish the config file with:
This are the contents of the published config file:
You can publish and run the migrations with (only for database store):
Usage
Facade
Create a Panic Control [^1]
Update a Panic Control [^1]
Get all Panic Control
Get a Panic Control
Check if Panic Control is Active
Helper
Check if Panic Control is Active
Command
List all Panic Control
Detail a Panic Control
Activate a Panic Control [^1]
Deactivate a Panic Control [^1]
Rules
We can add supplementary rules that will respect the main status
All rules must return true for the panic to be activated, if nothing is registered or return null|false, it is disregarded.
Route Name
Checks whether the Route::currentRouteName()
return is listed inside the route-name
key.
URL Path
Checks whether the Request::path()
return is listed the url-path
key.
Sampling
Will be activated for just a sample of the users, based on the number of chances, and the "out of" sample. In the example below, the panic control will be activated for 5 out of 10 users i.e. half of the users.
IMPORTANT: the chance is a probability, there may be a small variation both for more and for less.
User logged
Check if user logged id
or email
is listed the user
key.
Custom Rules
To create a custom rule follow the example
The class must be registered in config/panic-control.php
under the rules
key.
In the rules
column of the database, add the key registered in config/panic-control.php
with the parameters that will be sent to the class.
Drivers
By default, the driver configured in config('panic-control.default')
, but can be changed with support for: database, file, endpoint.
Extending Driver
This feature is in beta tests
If you want to include support for other driver, you can easily register a new driver in the AppServiceProvider
as shown below:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Alexssander Cusin
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
[^1]: Not supported for endpoint store.
All versions of panic-control-laravel with dependencies
guzzlehttp/guzzle Version ^7.7
illuminate/contracts Version >=10.0
spatie/laravel-package-tools Version ^1.14.0