1234567891011121314151617181920212223242526272829 |
- <?php
- namespace App\Base\Providers;
- use Illuminate\Database\Events\StatementPrepared;
- use Illuminate\Support\Facades\Event;
- use Laravel\Lumen\Providers\EventServiceProvider as ServiceProvider;
- class EventServiceProvider extends ServiceProvider
- {
- /**
- * The event listener mappings for the application.
- *
- * @var array
- */
- protected $listen = [
- 'App\Events\SomeEvent' => [
- 'App\Listeners\EventListener',
- ],
- ];
- public function boot()
- {
- Event::listen(StatementPrepared::class, function ($event) {
- $event->statement->setFetchMode(\PDO::FETCH_ASSOC);
- });
- }
- }
|