Download the PHP package esign/laravel-database-trigger without Composer
On this page you can find all versions of the php package esign/laravel-database-trigger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-database-trigger
Create database triggers from migrations
This package provides an easy way to manage database triggers within your Laravel application. Currently only MySQL is supported.
Installation
You can install the package via composer:
Usage
Creating triggers
To create a new database trigger, use the createTrigger
method on the Schema
facade.
The createTrigger
method accepts two arguments: the first is the name of the trigger, while the second is a closure which receives a DatabaseTrigger
object that may be used to define the new trigger:
Checking for trigger existence
You may check for the existence of a trigger by using the hasTrigger
method:
Dropping triggers
You may drop an existing trigger by using the dropTrigger
or dropTriggerIfExists
methods:
Generating migrations
You may use the make:trigger
artisan command to quickly generate a trigger migration:
This will publish a migration with the following contents:
A name for the trigger will automatically be created based on the provided input. In case you want to use a diffferent trigger name, you may pass it as the first argument:
Displaying existing triggers
To display a list of your existing triggers you may use the trigger:list
command:
Testing
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-database-trigger with dependencies
illuminate/support Version ^9.0|^10.0|^11.0
illuminate/database Version ^9.0|^10.0|^11.0