Download the PHP package asseco-voice/laravel-blueprint-audit without Composer
On this page you can find all versions of the php package asseco-voice/laravel-blueprint-audit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download asseco-voice/laravel-blueprint-audit
More information about asseco-voice/laravel-blueprint-audit
Files in asseco-voice/laravel-blueprint-audit
Package laravel-blueprint-audit
Short Description Laravel support for additional blueprint methods
License MIT
Informations about the package laravel-blueprint-audit
Blueprint audit
Purpose of this repository is to provide additional methods for migrations.
Installation
Require the package with composer require asseco-voice/laravel-blueprint-audit
.
Service provider will be registered automatically.
Usage
Call $table->audit()
within your migration to get these attributes:
or call $table->softDeleteAudit()
to additionally get also:
If you're using first one, add Audit
trait on your model, and for
second one add SoftDeleteAudit
trait to enable these attributes being
populated automatically.
_type
field is there to support if you have more than one type of entities
which can perform actions on resources (i.e. service
or user
).
You can modify how the IDs and types are being extracted by publishing the config
with php artisan vendor:publish --tag=asseco-blueprint-audit
and implementing
your own extractor class. Be sure your extended class implements Extractor
interface.
Runtime picker
There is a helper class which will enable you to pick timestamp types during runtime. So what you can do is define a config key which will be forwarded within a migration and will choose which migrations type to run.
Example, having the following migration:
Config value being one of the MigrationMethodPicker
types i.e. 'soft'
will
evaluate your migration to: