/** * @return callable */ protected function send() : callable { return function ($next, $pipe) { $run = $this->app->getContainer()->make($pipe); return $run($this->request, function () use($next) { return $next; }); }; }
/** * Returns the definition to register in the container. * * Definitions must be indexed by their entry ID. For example: * * return [ * 'logger' => ... * 'mailer' => ... * ]; * * @return array */ public function getDefinitions() { return [CommandBus::class => function () { return new TacticianBus($this->app->getContainer(), [new CommandHandlerMiddleware(new ClassNameExtractor(), new HandlerLocator($this->app->getContainer()), new HandleInflector())]); }]; }
/** * @param Throwable $e * @param $handler */ private function handle(Throwable $e, $handler) { $handler = $this->app->getContainer()->make($handler); $handler->handle($e); }
/** * @return Request */ protected function request() : Request { return $this->app->getContainer()->make(Request::class); }