container = $container; } /** * Returns the current broker. * * @return \Illuminate\Contracts\Container\Container */ public function getContainer(): ContainerContract { return $this->container ?? Container::getInstance(); } /** * Resolve the given type from the container. * * @param string $abstract * @return mixed */ public function resolve(string $abstract) { $concrete = null; try { $concrete = $this->getContainer() ->make($abstract); } catch (ReflectionException $exception) { // .. } catch (BindingResolutionException $exception) { // .. } catch (NotFoundExceptionInterface $exception) { // .. } return $concrete; } }