Symfony Exception

PDOException QueryException ViewException

HTTP 500 Internal Server Error

SQLSTATE[08001]: [Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection because an error was encountered during handshakes before login. Common causes include client attempting to connect to an unsupported version of SQL Server, server too busy to accept new connections or a resource limitation (memory or maximum allowed connections) on the server. (Connection: sqlsrv, SQL: select * from [service_translations] where [service_translations].[service_id] = 12 and [service_translations].[service_id] is not null) (View: /home/dwg-germany.de/dwg/resources/views/livewire/home.blade.php)

Exceptions 3

Illuminate\View\ ViewException

Show exception properties
Illuminate\View\ViewException {#1322
  #severity: E_ERROR
}
  1. throw new UniqueConstraintViolationException(
  2. $this->getName(), $query, $this->prepareBindings($bindings), $e
  3. );
  4. }
  5. throw new QueryException(
  6. $this->getName(), $query, $this->prepareBindings($bindings), $e
  7. );
  8. }
  9. }
  1. \Illuminate\View\Engines\PhpEngine::handleViewException($e, $obLevel);
  2. return;
  3. }
  4. parent::handleViewException($e, $obLevel);
  5. }
  6. public function shouldBypassExceptionForLivewire(\Throwable $e, $obLevel)
  7. {
  8. $uses = array_flip(class_uses_recursive($e));
  1. \Closure::bind(function () use ($__path, $__data) {
  2. extract($__data, EXTR_SKIP);
  3. include $__path;
  4. }, $component, $component)();
  5. } catch (\Exception|\Throwable $e) {
  6. $this->handleViewException($e, $obLevel);
  7. }
  8. return ltrim(ob_get_clean());
  9. }
  1. // Once we have the path to the compiled file, we will evaluate the paths with
  2. // typical PHP just like any other templates. We also keep a stack of views
  3. // which have been rendered for right exception messages to be generated.
  4. try {
  5. $results = $this->evaluatePath($this->compiler->getCompiledPath($path), $data);
  6. } catch (ViewException $e) {
  7. if (! Str::of($e->getMessage())->contains(['No such file or directory', 'File does not exist at path'])) {
  8. throw $e;
  9. }
  1. $currentComponent = ExtendBlade::currentRendering();
  2. trigger('view:compile', $currentComponent, $path);
  3. return parent::get($path, $data);
  4. }
  5. protected function evaluatePath($__path, $__data)
  6. {
  7. if (! ExtendBlade::isRenderingLivewireComponent()) {
  1. *
  2. * @return string
  3. */
  4. protected function getContents()
  5. {
  6. return $this->engine->get($this->path, $this->gatherData());
  7. }
  8. /**
  9. * Get the data bound to the view instance.
  10. *
  1. // clear out the sections for any separate views that may be rendered.
  2. $this->factory->incrementRender();
  3. $this->factory->callComposer($this);
  4. $contents = $this->getContents();
  5. // Once we've finished rendering the view, we'll decrement the render count
  6. // so that each section gets flushed out next time a view is created and
  7. // no old sections are staying around in the memory of an environment.
  8. $this->factory->decrementRender();
  1. * @throws \Throwable
  2. */
  3. public function render(?callable $callback = null)
  4. {
  5. try {
  6. $contents = $this->renderContents();
  7. $response = isset($callback) ? $callback($this, $contents) : null;
  8. // Once we have the contents of the view, we will flush the sections if we are
  9. // done rendering all views so that there is nothing left hanging over when
  1. $revertA = Utils::shareWithViews('__livewire', $component);
  2. $revertB = Utils::shareWithViews('_instance', $component); // @deprecated
  3. $viewContext = new ViewContext;
  4. $html = $view->render(function ($view) use ($viewContext) {
  5. // Extract leftover slots, sections, and pushes before they get flushed...
  6. $viewContext->extractFromEnvironment($view->getFactory());
  7. });
  8. $revertA(); $revertB();
  1. protected function trackInRenderStack($component, $callback)
  2. {
  3. array_push(static::$renderStack, $component);
  4. return tap($callback(), function () {
  5. array_pop(static::$renderStack);
  6. });
  7. }
  8. protected function updateProperties($component, $updates, $data, $context)
  1. ]);
  2. }
  3. [ $view, $properties ] = $this->getView($component);
  4. return $this->trackInRenderStack($component, function () use ($component, $view, $properties) {
  5. $finish = trigger('render', $component, $view, $properties);
  6. $revertA = Utils::shareWithViews('__livewire', $component);
  7. $revertB = Utils::shareWithViews('_instance', $component); // @deprecated
  1. if (config('app.debug')) $start = microtime(true);
  2. $finish = trigger('mount', $component, $params, $key, $parent);
  3. if (config('app.debug')) trigger('profile', 'mount', $component->getId(), [$start, microtime(true)]);
  4. if (config('app.debug')) $start = microtime(true);
  5. $html = $this->render($component, '<div></div>');
  6. if (config('app.debug')) trigger('profile', 'render', $component->getId(), [$start, microtime(true)]);
  7. if (config('app.debug')) $start = microtime(true);
  8. trigger('dehydrate', $component, $context);
  1. return app(ComponentRegistry::class)->resolveMissingComponent($resolver);
  2. }
  3. function mount($name, $params = [], $key = null)
  4. {
  5. return app(HandleComponents::class)->mount($name, $params, $key);
  6. }
  7. function snapshot($component, $context = null)
  8. {
  9. return app(HandleComponents::class)->snapshot($component, $context);
  1. $html = null;
  2. $layoutConfig = SupportPageComponents::interceptTheRenderOfTheComponentAndRetreiveTheLayoutConfiguration(function () use (&$html) {
  3. $params = SupportPageComponents::gatherMountMethodParamsFromRouteParameters($this);
  4. $html = app('livewire')->mount($this::class, $params);
  5. });
  6. $layoutConfig = $layoutConfig ?: new PageComponentConfig;
  7. $layoutConfig->normalizeViewNameAndParamsForBladeComponents();
  1. });
  2. on('render', $handler);
  3. on('render.placeholder', $handler);
  4. $callback();
  5. off('render', $handler);
  6. off('render.placeholder', $handler);
  7. return $layoutConfig;
in /home/dwg-germany.de/dwg/vendor/livewire/livewire/src/Features/SupportPageComponents/HandlesPageComponents.php :: interceptTheRenderOfTheComponentAndRetreiveTheLayoutConfiguration (line 14)
  1. // Here's we're hooking into the "__invoke" method being called on a component.
  2. // This way, users can pass Livewire components into Routes as if they were
  3. // simple invokable controllers. Ex: Route::get('...', SomeLivewireComponent::class);
  4. $html = null;
  5. $layoutConfig = SupportPageComponents::interceptTheRenderOfTheComponentAndRetreiveTheLayoutConfiguration(function () use (&$html) {
  6. $params = SupportPageComponents::gatherMountMethodParamsFromRouteParameters($this);
  7. $html = app('livewire')->mount($this::class, $params);
  8. });
  1. if (method_exists($controller, 'callAction')) {
  2. return $controller->callAction($method, $parameters);
  3. }
  4. return $controller->{$method}(...array_values($parameters));
  5. }
  6. /**
  7. * Resolve the parameters for the controller.
  8. *
  1. *
  2. * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
  3. */
  4. protected function runController()
  5. {
  6. return $this->controllerDispatcher()->dispatch(
  7. $this, $this->getController(), $this->getControllerMethod()
  8. );
  9. }
  10. /**
  1. {
  2. $this->container = $this->container ?: new Container;
  3. try {
  4. if ($this->isControllerAction()) {
  5. return $this->runController();
  6. }
  7. return $this->runCallable();
  8. } catch (HttpResponseException $e) {
  9. return $e->getResponse();
  1. return (new Pipeline($this->container))
  2. ->send($request)
  3. ->through($middleware)
  4. ->then(fn ($request) => $this->prepareResponse(
  5. $request, $route->run()
  6. ));
  7. }
  8. /**
  9. * Gather the middleware for the given route with resolved class names.
  1. */
  2. protected function prepareDestination(Closure $destination)
  3. {
  4. return function ($passable) use ($destination) {
  5. try {
  6. return $destination($passable);
  7. } catch (Throwable $e) {
  8. return $this->handleException($passable, $e);
  9. }
  10. };
  11. }
Pipeline->Illuminate\Pipeline\{closure}() in /home/dwg-germany.de/dwg/app/Http/Middleware/Shared.php (line 25)
  1. $footer_header=PageContent::whereIN('page', ['footer','header'])
  2. ->where('locale', app()->getLocale())
  3. ->pluck('value', 'key')
  4. ->toArray();
  5. View::share('footer_header', $footer_header);
  6. return $next($request);
  7. }
  8. }
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
Pipeline->Illuminate\Pipeline\{closure}() in /home/dwg-germany.de/dwg/app/Http/Middleware/SetLocale.php (line 24)
  1. App::setLocale($locale);
  2. // dd(0);
  3. // return redirect($locale . '/' . $request->path());
  4. }
  5. return $next($request);
  6. }
  7. }
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. }
  2. throw $exception;
  3. }
  4. return $next($request);
  5. }
  6. }
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. $this->isReading($request) ||
  2. $this->runningUnitTests() ||
  3. $this->inExceptArray($request) ||
  4. $this->tokensMatch($request)
  5. ) {
  6. return tap($next($request), function ($response) use ($request) {
  7. if ($this->shouldAddXsrfTokenCookie()) {
  8. $this->addCookieToResponse($request, $response);
  9. }
  10. });
  11. }
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. // Putting the errors in the view for every view allows the developer to just
  2. // assume that some errors are always available, which is convenient since
  3. // they don't have to continually run checks for the presence of errors.
  4. return $next($request);
  5. }
  6. }
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. $this->startSession($request, $session)
  2. );
  3. $this->collectGarbage($session);
  4. $response = $next($request);
  5. $this->storeCurrentUrl($request, $session);
  6. $this->addCookieToResponse($response, $session);
  1. if ($this->manager->shouldBlock() ||
  2. ($request->route() instanceof Route && $request->route()->locksFor())) {
  3. return $this->handleRequestWhileBlocking($request, $session, $next);
  4. }
  5. return $this->handleStatefulRequest($request, $session, $next);
  6. }
  7. /**
  8. * Handle the given request within session state.
  9. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. * @param \Closure $next
  2. * @return mixed
  3. */
  4. public function handle($request, Closure $next)
  5. {
  6. $response = $next($request);
  7. foreach ($this->cookies->getQueuedCookies() as $cookie) {
  8. $response->headers->setCookie($cookie);
  9. }
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. * @param \Closure $next
  2. * @return \Symfony\Component\HttpFoundation\Response
  3. */
  4. public function handle($request, Closure $next)
  5. {
  6. return $this->encrypt($next($this->decrypt($request)));
  7. }
  8. /**
  9. * Decrypt the cookies on the request.
  10. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. $pipeline = array_reduce(
  2. array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
  3. );
  4. try {
  5. return $pipeline($this->passable);
  6. } finally {
  7. if ($this->finally) {
  8. ($this->finally)($this->passable);
  9. }
  10. }
  1. $middleware = $shouldSkipMiddleware ? [] : $this->gatherRouteMiddleware($route);
  2. return (new Pipeline($this->container))
  3. ->send($request)
  4. ->through($middleware)
  5. ->then(fn ($request) => $this->prepareResponse(
  6. $request, $route->run()
  7. ));
  8. }
  9. /**
  1. $request->setRouteResolver(fn () => $route);
  2. $this->events->dispatch(new RouteMatched($route, $request));
  3. return $this->prepareResponse($request,
  4. $this->runRouteWithinStack($route, $request)
  5. );
  6. }
  7. /**
  8. * Run the given route within a Stack "onion" instance.
  1. * @param \Illuminate\Http\Request $request
  2. * @return \Symfony\Component\HttpFoundation\Response
  3. */
  4. public function dispatchToRoute(Request $request)
  5. {
  6. return $this->runRoute($request, $this->findRoute($request));
  7. }
  8. /**
  9. * Find the route matching a given request.
  10. *
  1. */
  2. public function dispatch(Request $request)
  3. {
  4. $this->currentRequest = $request;
  5. return $this->dispatchToRoute($request);
  6. }
  7. /**
  8. * Dispatch the request to a route and return the response.
  9. *
  1. protected function dispatchToRouter()
  2. {
  3. return function ($request) {
  4. $this->app->instance('request', $request);
  5. return $this->router->dispatch($request);
  6. };
  7. }
  8. /**
  9. * Call the terminate method on any terminable middleware.
  1. */
  2. protected function prepareDestination(Closure $destination)
  3. {
  4. return function ($passable) use ($destination) {
  5. try {
  6. return $destination($passable);
  7. } catch (Throwable $e) {
  8. return $this->handleException($passable, $e);
  9. }
  10. };
  11. }
  1. * @param \Closure $next
  2. * @return mixed
  3. */
  4. public function handle($request, Closure $next)
  5. {
  6. $response = $next($request);
  7. if ($response instanceof Response && SupportDisablingBackButtonCache::$disableBackButtonCache){
  8. $response->headers->add([
  9. 'Pragma' => 'no-cache',
  10. 'Expires' => 'Fri, 01 Jan 1990 00:00:00 GMT',
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. */
  2. public function handle($request, Closure $next)
  3. {
  4. $this->clean($request);
  5. return $next($request);
  6. }
  7. /**
  8. * Clean the request's data.
  9. *
  1. if ($callback($request)) {
  2. return $next($request);
  3. }
  4. }
  5. return parent::handle($request, $next);
  6. }
  7. /**
  8. * Transform the given value.
  9. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. */
  2. public function handle($request, Closure $next)
  3. {
  4. $this->clean($request);
  5. return $next($request);
  6. }
  7. /**
  8. * Clean the request's data.
  9. *
  1. if ($callback($request)) {
  2. return $next($request);
  3. }
  4. }
  5. return parent::handle($request, $next);
  6. }
  7. /**
  8. * Transform the given value.
  9. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. if ($max > 0 && $request->server('CONTENT_LENGTH') > $max) {
  2. throw new PostTooLargeException('The POST data is too large.');
  3. }
  4. return $next($request);
  5. }
  6. /**
  7. * Determine the server 'post_max_size' as bytes.
  8. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. null,
  2. $this->getHeaders($data)
  3. );
  4. }
  5. return $next($request);
  6. }
  7. /**
  8. * Determine if the incoming request has a maintenance mode bypass cookie.
  9. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. * @return \Illuminate\Http\Response
  2. */
  3. public function handle($request, Closure $next)
  4. {
  5. if (! $this->hasMatchingPath($request)) {
  6. return $next($request);
  7. }
  8. $this->cors->setOptions($this->container['config']->get('cors', []));
  9. if ($this->cors->isPreflightRequest($request)) {
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. {
  2. $request::setTrustedProxies([], $this->getTrustedHeaderNames());
  3. $this->setTrustedProxyIpAddresses($request);
  4. return $next($request);
  5. }
  6. /**
  7. * Sets the trusted proxies on the request.
  8. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. * @param \Closure $next
  2. * @return \Symfony\Component\HttpFoundation\Response
  3. */
  4. public function handle(Request $request, Closure $next)
  5. {
  6. return $next($request);
  7. }
  8. /**
  9. * Invoke the deferred callbacks.
  10. *
  1. // since the object we're given was already a fully instantiated object.
  2. $parameters = [$passable, $stack];
  3. }
  4. $carry = method_exists($pipe, $this->method)
  5. ? $pipe->{$this->method}(...$parameters)
  6. : $pipe(...$parameters);
  7. return $this->handleCarry($carry);
  8. } catch (Throwable $e) {
  9. return $this->handleException($passable, $e);
  1. $pipeline = array_reduce(
  2. array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
  3. );
  4. try {
  5. return $pipeline($this->passable);
  6. } finally {
  7. if ($this->finally) {
  8. ($this->finally)($this->passable);
  9. }
  10. }
  1. $this->bootstrap();
  2. return (new Pipeline($this->app))
  3. ->send($request)
  4. ->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
  5. ->then($this->dispatchToRouter());
  6. }
  7. /**
  8. * Bootstrap the application for HTTP requests.
  9. *
  1. $this->requestStartedAt = Carbon::now();
  2. try {
  3. $request->enableHttpMethodParameterOverride();
  4. $response = $this->sendRequestThroughRouter($request);
  5. } catch (Throwable $e) {
  6. $this->reportException($e);
  7. $response = $this->renderException($request, $e);
  8. }
  1. */
  2. public function handleRequest(Request $request)
  3. {
  4. $kernel = $this->make(HttpKernelContract::class);
  5. $response = $kernel->handle($request)->send();
  6. $kernel->terminate($request, $response);
  7. }
  8. /**
Application->handleRequest() in /home/dwg-germany.de/dwg/public/index.php (line 17)
  1. // Register the Composer autoloader...
  2. require __DIR__.'/../vendor/autoload.php';
  3. // Bootstrap Laravel and handle the request...
  4. (require_once __DIR__.'/../bootstrap/app.php')
  5. ->handleRequest(Request::capture());

Illuminate\Database\ QueryException

SQLSTATE[08001]: [Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection because an error was encountered during handshakes before login. Common causes include client attempting to connect to an unsupported version of SQL Server, server too busy to accept new connections or a resource limitation (memory or maximum allowed connections) on the server. (Connection: sqlsrv, SQL: select * from [service_translations] where [service_translations].[service_id] = 12 and [service_translations].[service_id] is not null)

  1. throw new UniqueConstraintViolationException(
  2. $this->getName(), $query, $this->prepareBindings($bindings), $e
  3. );
  4. }
  5. throw new QueryException(
  6. $this->getName(), $query, $this->prepareBindings($bindings), $e
  7. );
  8. }
  9. }
  1. protected function tryAgainIfCausedByLostConnection(QueryException $e, $query, $bindings, Closure $callback)
  2. {
  3. if ($this->causedByLostConnection($e->getPrevious())) {
  4. $this->reconnect();
  5. return $this->runQueryCallback($query, $bindings, $callback);
  6. }
  7. throw $e;
  8. }
  1. {
  2. if ($this->transactions >= 1) {
  3. throw $e;
  4. }
  5. return $this->tryAgainIfCausedByLostConnection(
  6. $e, $query, $bindings, $callback
  7. );
  8. }
  9. /**
  1. // caused by a connection that has been lost. If that is the cause, we'll try
  2. // to re-establish connection and re-run the query with a fresh connection.
  3. try {
  4. $result = $this->runQueryCallback($query, $bindings, $callback);
  5. } catch (QueryException $e) {
  6. $result = $this->handleQueryException(
  7. $e, $query, $bindings, $callback
  8. );
  9. }
  10. // Once we have run the query we will calculate the time that it took to run and
  1. * @param bool $useReadPdo
  2. * @return array
  3. */
  4. public function select($query, $bindings = [], $useReadPdo = true)
  5. {
  6. return $this->run($query, $bindings, function ($query, $bindings) use ($useReadPdo) {
  7. if ($this->pretending()) {
  8. return [];
  9. }
  10. // For select statements, we'll simply execute the query and return an array
  1. *
  2. * @return array
  3. */
  4. protected function runSelect()
  5. {
  6. return $this->connection->select(
  7. $this->toSql(), $this->getBindings(), ! $this->useWritePdo
  8. );
  9. }
  10. /**
  1. * @return \Illuminate\Support\Collection<int, \stdClass>
  2. */
  3. public function get($columns = ['*'])
  4. {
  5. $items = new Collection($this->onceWithColumns(Arr::wrap($columns), function () {
  6. return $this->processor->processSelect($this, $this->runSelect());
  7. }));
  8. return $this->applyAfterQueryCallbacks(
  9. isset($this->groupLimit) ? $this->withoutGroupLimitKeys($items) : $items
  10. );
  1. if (is_null($original)) {
  2. $this->columns = $columns;
  3. }
  4. $result = $callback();
  5. $this->columns = $original;
  6. return $result;
  7. }
  1. * @param array|string $columns
  2. * @return \Illuminate\Support\Collection<int, \stdClass>
  3. */
  4. public function get($columns = ['*'])
  5. {
  6. $items = new Collection($this->onceWithColumns(Arr::wrap($columns), function () {
  7. return $this->processor->processSelect($this, $this->runSelect());
  8. }));
  9. return $this->applyAfterQueryCallbacks(
  10. isset($this->groupLimit) ? $this->withoutGroupLimitKeys($items) : $items
  1. * @return array<int, TModel>
  2. */
  3. public function getModels($columns = ['*'])
  4. {
  5. return $this->model->hydrate(
  6. $this->query->get(