Download the PHP package dariusiii/laravel-database-trigger without Composer

On this page you can find all versions of the php package dariusiii/laravel-database-trigger. 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 laravel-database-trigger

Add database trigger to laravel migrations

Build Status

Laravel Database Trigger provides a way to add database trigger to laravel migrations just like you would with database table. A trigger is a named database object that is associated with a table, and that activates when a particular event occurs for the table. Read more about triggers here.

Installation

Laravel Database Trigger requires at least PHP 7.3. This particular version supports Laravel v8.*. Check the table below for versions support.

Package version Laravel version PHP version
1 5.5, 5.6, 5.7 >= 7.1
2.* 5.8 >= 7.1.3
3.* 6.* >= 7.2.5 or >= 8.0
4.* 7.* >= 7.2.5 or >= 8.0
5.* 8.* >= 7.3 or >= 8.0

The package currently supports MySQL only.

To get the latest version, simply require the package using Composer:

Once installed, if you are not using automatic package discovery, then you need to register the NtimYeboah\LaravelDatabaseTrigger\TriggerServiceProvider service provider in your config/app.php.

Usage

Create a trigger migration file using the make:trigger artisan command. The command requires the name of the trigger, name of the event object table, action timing and the event that activates the trigger.

Event object table

The event object table is the name of the table the trigger is associated with.

Action timing

The activation time for the trigger. Possible values are after and before.

after - Process action after the change is made on the event object table.

before - Process action prior to the change is made on the event object table.

Event

The event to activate trigger. A trigger event can be insert, update and delete.

insert - Activate trigger when an insert operation is performed on the event object table.

update - Activate trigger when an update operation is performed on the event object table.

delete - Activate trigger when a delete operation is performed on the event object table.

The following trigger migration file will be generated for a trigger that uses after_users_update as a name, users as event object table name, after as action timing and update as event.

Return the trigger statement from the closure of the statement method.

The following is an example trigger migration to insert into the users_audit table after updating a user row.

Testing

Run the tests with:

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover a security vulnerability within this package, please send an e-mail to Ntim Yeboah at [email protected]. All security vulnerabilities will be promptly addressed.

License

Laravel Database Trigger is licensed under The MIT License (MIT).


All versions of laravel-database-trigger with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0
laravel/framework Version ^8.75
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 dariusiii/laravel-database-trigger contains the following files

Loading the files please wait ....