nordsoftware/lumen-core

View on GitHub
src/Traits/FiresEvents.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Nord\Lumen\Core\Traits;

use Illuminate\Contracts\Events\Dispatcher;

trait FiresEvents
{
    /**
     * @param string|object $event
     * @param array         $payload
     * @param bool|false    $halt
     *
     * @return array|null
     */
    private function fireEvent($event, $payload = [], $halt = false)
    {
        return $this->getEventDispatcher()->fire($event, $payload, $halt);
    }

    /**
     * @return Dispatcher
     */
    private function getEventDispatcher()
    {
        return app(Dispatcher::class);
    }
}