/** * Get the first item from the collection. * * @param callable|null $callback * @param mixed $default * @return mixed */ public function first(callable $callback = null, $default = null) { return Arr::first($this->items, $callback, $default); }
/** * Get the registered service provider instance if it exists. * * @param ServiceProvider|string $provider * @return ServiceProvider|null */ public function getProvider($provider) { $name = is_string($provider) ? $provider : get_class($provider); return Arr::first($this->serviceProviders, function ($key, $value) use($name) { return $value instanceof $name; }); }