Schema::table('table', function (Blueprint $table) {
...
$table->createTrigger($name)
->before() // or ->after() // and by default 'BEFORE'
->event('INSERT') // or ->event(['INSERT', 'UPDATE']) // and by default INSERT
->language() // by default 'plpgsql'
->declare([
'delta_time_key' => 'integer',
'delta_amount_sold' => 'numeric(15,2)',
]) // and by default is empty []
->body($statement, $bindings = []) // and by default body is empty, $bindings is empty
;
});
What parameters should be able to customize:
How it can be used: