PHP code example of shiftonelabs / laravel-db-events
1. Go to this page and download the library: Download shiftonelabs/laravel-db-events library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
app('events')->listen('ShiftOneLabs\LaravelDbEvents\Extension\Database\Events\DatabaseConnecting', function ($event) {
// don't connect to mysql in strict mode if you like zeroed out dates
if (i_like_zero_dates()) {
$event->config['strict'] = false;
}
});
app('events')->listen('ShiftOneLabs\LaravelDbEvents\Extension\Database\Events\DatabaseConnecting', function ($event) {
if (not_todaaay()) {
return false;
}
});