Download the PHP package jimchen/laravel-trigger without Composer

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

laravel-trigger

Latest Stable Version Total Downloads GitHub license

Subscribe MySQL events like jQuery, base on php-mysql-replication

中文说明

MySQL server settings

In your MySQL server configuration file you need to enable replication:

[mysqld]
server-id        = 1
log_bin          = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size  = 100M
binlog_row_image = full
binlog-format    = row #Very important if you want to receive write, update and delete row events
Mysql replication events explained https://dev.mysql.com/doc/internals/en/event-meanings.html

Mysql user privileges:

GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'user'@'host';

GRANT SELECT ON `dbName`.* TO 'user'@'host';

Installation

Laravel

install

composer require jimchen/laravel-trigger

publish config

php artisan vendor:publish --provider="JimChen\Trigger\TriggerServiceProvider"

Lumen

install

composer require jimchen/laravel-trigger

edit bootstrap/app.php add:

$app->register(JimChen\Trigger\TriggerServiceProvider::class);
...
$app->configure('trigger');

publish config and route

php artisan trigger:install [--force]

Configure

edit .env, add:

TRIGGER_HOST=192.168.xxx.xxx
TRIGGER_PORT=3306
TRIGGER_USER=username
TRIGGER_PASSWORD=password
...

Usage

php artisan trigger:start [-R=xxx]

Subscriber

more subscriber usage

EventSubscribers

Event Route

common

$trigger->on('database.table', 'write', function($event) { /* do something */ });

multi-tables and multi-evnets

$trigger->on('database.table1,database.table2', 'write,update', function($event) { /* do something */ });

multi-events

$trigger->on('database.table1,database.table2', [
    'write'  => function($event) { /* do something */ },
    'update' => function($event) { /* do something */ },
]);

action as controller

$trigger->on('database.table', 'write', 'App\\Http\\Controllers\\ExampleController'); // call default method 'handle'
$trigger->on('database.table', 'write', 'App\\Http\\Controllers\\ExampleController@write');

action as callable

class Foo
{
    public static function bar($event)
    {
        dump($event);
    }
}

$trigger->on('database.table', 'write', 'Foo@bar'); // call default method 'handle'
$trigger->on('database.table', 'write', ['Foo', 'bar']);

action as job

Job

namespace App\Jobs;

class ExampleJob extends Job
{
    private $event;

    public function __construct($event)
    {
        $this->event = $event;
    }

    public function handle()
    {
        dump($this->event);
    }
}

Route

$trigger->on('database.table', 'write', 'App\Jobs\ExampleJob'); // call default method 'dispatch'
$trigger->on('database.table', 'write', 'App\Jobs\ExampleJob@dispatch_now');

Event List

php artisan trigger:list [-R=xxx]

Terminate

php artisan trigger:terminate [-R=xxx]

Thanks to

JetBrains


All versions of laravel-trigger with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
laravel/framework Version ^5.5|^5.6|^5.7|^5.8|^6.0|^7.0
krowinski/php-mysql-replication Version ^6.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 jimchen/laravel-trigger contains the following files

Loading the files please wait ....