Symfony Exception

No query results for model [App\Models\Ad] 28

Exceptions 2

Symfony\Component\HttpKernel\Exception\ NotFoundHttpException

  1.         }
  2.         if ($e instanceof HttpResponseException) {
  3.             return $e->getResponse();
  4.         } elseif ($e instanceof ModelNotFoundException) {
  5.             $e = new NotFoundHttpException($e->getMessage(), $e);
  6.         } elseif ($e instanceof AuthorizationException) {
  7.             $e = new HttpException(403$e->getMessage());
  8.         } elseif ($e instanceof ValidationException && $e->getResponse()) {
  9.             return $e->getResponse();
  10.         }
Handler->render() in /var/www/cvandaag/app/Exceptions/Handler.php (line 93)
  1.                 }
  2.             }
  3.             return ApiResponse::error($statusCode$message$data);
  4.         }
  5.         return parent::render($request$exception);
  6.     }
  7. }
  1.         $handler $this->container->make(ExceptionHandler::class);
  2.         $handler->report($e);
  3.         return $handler->render($passable$e);
  4.     }
  5. }
  1.     {
  2.         return function ($passable) use ($destination) {
  3.             try {
  4.                 return $destination($passable);
  5.             } catch (Throwable $e) {
  6.                 return $this->handleException($passable$e);
  7.             }
  8.         };
  9.     }
  10.     /**
Pipeline->Laravel\Lumen\Routing\{closure}() in /var/www/cvandaag/app/Http/Middleware/AddHeaderAccessToken.php (line 22)
  1.     {
  2.         if ($request->has('access_token') && !$request->header('Authorization')) {
  3.             $request->headers->set('Authorization''Bearer ' $request->get('access_token'));
  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.         return function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
Pipeline->Laravel\Lumen\Routing\{closure}() in /var/www/cvandaag/app/Http/Middleware/CorsMiddleware.php (line 27)
  1.         //Intercepts OPTIONS requests
  2.         if($request->isMethod('OPTIONS')) {
  3.             $response response(''200);
  4.         } else {
  5.             // Pass the request to the next middleware
  6.             $response $next($request);
  7.         }
  8.         // The header method is not implemented in the BinaryFileResponse class so we skip it.
  9.         // Needed for downloading files.
  10.         if ($response instanceof BinaryFileResponse) {
  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 function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
in /var/www/cvandaag/vendor/illuminate/pipeline/Pipeline.php -> Laravel\Lumen\Routing\{closure} (line 103)
  1.     {
  2.         $pipeline array_reduce(
  3.             array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
  4.         );
  5.         return $pipeline($this->passable);
  6.     }
  7.     /**
  8.      * Run the pipeline and return the result.
  9.      *
  1.     {
  2.         if (count($middleware) > && ! $this->shouldSkipMiddleware()) {
  3.             return (new Pipeline($this))
  4.                 ->send($this->make('request'))
  5.                 ->through($middleware)
  6.                 ->then($then);
  7.         }
  8.         return $then($this->make('request'));
  9.     }
  1.                 }
  2.                 return $this->handleDispatcherResponse(
  3.                     $this->createDispatcher()->dispatch($method$pathInfo)
  4.                 );
  5.             });
  6.         } catch (Throwable $e) {
  7.             return $this->prepareResponse($this->sendExceptionToHandler($e));
  8.         }
  9.     }
  1.      * @param  \Symfony\Component\HttpFoundation\Request|null  $request
  2.      * @return void
  3.      */
  4.     public function run($request null)
  5.     {
  6.         $response $this->dispatch($request);
  7.         if ($response instanceof SymfonyResponse) {
  8.             $response->send();
  9.         } else {
  10.             echo (string) $response;
Application->run() in /var/www/cvandaag/public/index.php (line 28)
  1. | the client's browser allowing them to enjoy the creative
  2. | and wonderful application we have prepared for them.
  3. |
  4. */
  5. $app->run();

Illuminate\Database\Eloquent\ ModelNotFoundException

No query results for model [App\Models\Ad] 28

  1.             }
  2.         } elseif (! is_null($result)) {
  3.             return $result;
  4.         }
  5.         throw (new ModelNotFoundException)->setModel(
  6.             get_class($this->model), $id
  7.         );
  8.     }
  9.     /**
  1.      * @throws \BadMethodCallException
  2.      */
  3.     protected function forwardCallTo($object$method$parameters)
  4.     {
  5.         try {
  6.             return $object->{$method}(...$parameters);
  7.         } catch (Error|BadMethodCallException $e) {
  8.             $pattern '~^Call to undefined method (?P<class>[^:]+)::(?P<method>[^\(]+)\(\)$~';
  9.             if (! preg_match($pattern$e->getMessage(), $matches)) {
  10.                 throw $e;
  1.         if ($resolver = (static::$relationResolvers[get_class($this)][$method] ?? null)) {
  2.             return $resolver($this);
  3.         }
  4.         return $this->forwardCallTo($this->newQuery(), $method$parameters);
  5.     }
  6.     /**
  7.      * Handle dynamic static method calls into the model.
  8.      *
  1.      * @param  array  $parameters
  2.      * @return mixed
  3.      */
  4.     public static function __callStatic($method$parameters)
  5.     {
  6.         return (new static)->$method(...$parameters);
  7.     }
  8.     /**
  9.      * Convert the model to its string representation.
  10.      *
  1.     }
  2.     public function click(Request $request$adId null)
  3.     {
  4.         if (is_numeric($adId)) {
  5.             $ad Ad::findOrFail($adId);
  6.             if ($ad) {
  7.                 AdHit::registerEvent($adId$ad->campaign_id$ad->customer_id001);
  8.                 return redirect($ad->url ?? 'https://cvandaag.nl/');
  9.             }
  1.         if (static::isCallableWithAtSign($callback) || $defaultMethod) {
  2.             return static::callClass($container$callback$parameters$defaultMethod);
  3.         }
  4.         return static::callBoundMethod($container$callback, function () use ($container$callback$parameters) {
  5.             return $callback(...array_values(static::getMethodDependencies($container$callback$parameters)));
  6.         });
  7.     }
  8.     /**
  9.      * Call a string reference to a class using Class@method syntax.
in /var/www/cvandaag/vendor/illuminate/container/Util.php :: Illuminate\Container\{closure} (line 40)
  1.      * @param  mixed  $value
  2.      * @return mixed
  3.      */
  4.     public static function unwrapIfClosure($value)
  5.     {
  6.         return $value instanceof Closure $value() : $value;
  7.     }
  8.     /**
  9.      * Get the class name of the given parameter's type, if possible.
  10.      *
  1.         if ($container->hasMethodBinding($method)) {
  2.             return $container->callMethodBinding($method$callback[0]);
  3.         }
  4.         return Util::unwrapIfClosure($default);
  5.     }
  6.     /**
  7.      * Normalize the given callback into a Class@method string.
  8.      *
  1.             return static::callClass($container$callback$parameters$defaultMethod);
  2.         }
  3.         return static::callBoundMethod($container$callback, function () use ($container$callback$parameters) {
  4.             return $callback(...array_values(static::getMethodDependencies($container$callback$parameters)));
  5.         });
  6.     }
  7.     /**
  8.      * Call a string reference to a class using Class@method syntax.
  9.      *
  1.      *
  2.      * @throws \InvalidArgumentException
  3.      */
  4.     public function call($callback, array $parameters = [], $defaultMethod null)
  5.     {
  6.         return BoundMethod::call($this$callback$parameters$defaultMethod);
  7.     }
  8.     /**
  9.      * Get a closure to resolve the given type from the container.
  10.      *
  1.      */
  2.     protected function callControllerCallable(callable $callable, array $parameters = [])
  3.     {
  4.         try {
  5.             return $this->prepareResponse(
  6.                 $this->call($callable$parameters)
  7.             );
  8.         } catch (HttpResponseException $e) {
  9.             return $e->getResponse();
  10.         }
  11.     }
  1.             return $this->callLumenControllerWithMiddleware(
  2.                 $instance$method$routeInfo$middleware
  3.             );
  4.         } else {
  5.             return $this->callControllerCallable(
  6.                 [$instance$method], $routeInfo[2]
  7.             );
  8.         }
  9.     }
  10.     /**
  1.         if (! method_exists($instance $this->make($controller), $method)) {
  2.             throw new NotFoundHttpException;
  3.         }
  4.         if ($instance instanceof LumenController) {
  5.             return $this->callLumenController($instance$method$routeInfo);
  6.         } else {
  7.             return $this->callControllerCallable(
  8.                 [$instance$method], $routeInfo[2]
  9.             );
  10.         }
  1.     protected function callActionOnArrayBasedRoute($routeInfo)
  2.     {
  3.         $action $routeInfo[1];
  4.         if (isset($action['uses'])) {
  5.             return $this->prepareResponse($this->callControllerAction($routeInfo));
  6.         }
  7.         foreach ($action as $value) {
  8.             if ($value instanceof Closure) {
  9.                 $callable $value->bindTo(new RoutingClosure);
  1.                 return $this->callActionOnArrayBasedRoute($this['request']->route());
  2.             }));
  3.         }
  4.         return $this->prepareResponse(
  5.             $this->callActionOnArrayBasedRoute($routeInfo)
  6.         );
  7.     }
  8.     /**
  9.      * Call the Closure or invokable on the array based route.
  1.             case Dispatcher::NOT_FOUND:
  2.                 throw new NotFoundHttpException;
  3.             case Dispatcher::METHOD_NOT_ALLOWED:
  4.                 throw new MethodNotAllowedHttpException($routeInfo[1]);
  5.             case Dispatcher::FOUND:
  6.                 return $this->handleFoundRoute($routeInfo);
  7.         }
  8.     }
  9.     /**
  10.      * Handle a route found by the dispatcher.
  1.                 if (isset($this->router->getRoutes()[$method.$pathInfo])) {
  2.                     return $this->handleFoundRoute([true$this->router->getRoutes()[$method.$pathInfo]['action'], []]);
  3.                 }
  4.                 return $this->handleDispatcherResponse(
  5.                     $this->createDispatcher()->dispatch($method$pathInfo)
  6.                 );
  7.             });
  8.         } catch (Throwable $e) {
  9.             return $this->prepareResponse($this->sendExceptionToHandler($e));
  10.         }
  1.      */
  2.     protected function prepareDestination(BaseClosure $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->Laravel\Lumen\Routing\{closure}() in /var/www/cvandaag/app/Http/Middleware/AddHeaderAccessToken.php (line 22)
  1.     {
  2.         if ($request->has('access_token') && !$request->header('Authorization')) {
  3.             $request->headers->set('Authorization''Bearer ' $request->get('access_token'));
  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.         return function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
Pipeline->Laravel\Lumen\Routing\{closure}() in /var/www/cvandaag/app/Http/Middleware/CorsMiddleware.php (line 27)
  1.         //Intercepts OPTIONS requests
  2.         if($request->isMethod('OPTIONS')) {
  3.             $response response(''200);
  4.         } else {
  5.             // Pass the request to the next middleware
  6.             $response $next($request);
  7.         }
  8.         // The header method is not implemented in the BinaryFileResponse class so we skip it.
  9.         // Needed for downloading files.
  10.         if ($response instanceof BinaryFileResponse) {
  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 function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
in /var/www/cvandaag/vendor/illuminate/pipeline/Pipeline.php -> Laravel\Lumen\Routing\{closure} (line 103)
  1.     {
  2.         $pipeline array_reduce(
  3.             array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
  4.         );
  5.         return $pipeline($this->passable);
  6.     }
  7.     /**
  8.      * Run the pipeline and return the result.
  9.      *
  1.     {
  2.         if (count($middleware) > && ! $this->shouldSkipMiddleware()) {
  3.             return (new Pipeline($this))
  4.                 ->send($this->make('request'))
  5.                 ->through($middleware)
  6.                 ->then($then);
  7.         }
  8.         return $then($this->make('request'));
  9.     }
  1.                 }
  2.                 return $this->handleDispatcherResponse(
  3.                     $this->createDispatcher()->dispatch($method$pathInfo)
  4.                 );
  5.             });
  6.         } catch (Throwable $e) {
  7.             return $this->prepareResponse($this->sendExceptionToHandler($e));
  8.         }
  9.     }
  1.      * @param  \Symfony\Component\HttpFoundation\Request|null  $request
  2.      * @return void
  3.      */
  4.     public function run($request null)
  5.     {
  6.         $response $this->dispatch($request);
  7.         if ($response instanceof SymfonyResponse) {
  8.             $response->send();
  9.         } else {
  10.             echo (string) $response;
Application->run() in /var/www/cvandaag/public/index.php (line 28)
  1. | the client's browser allowing them to enjoy the creative
  2. | and wonderful application we have prepared for them.
  3. |
  4. */
  5. $app->run();

Stack Traces 2

[2/2] NotFoundHttpException
Symfony\Component\HttpKernel\Exception\NotFoundHttpException:
No query results for model [App\Models\Ad] 28

  at /var/www/cvandaag/vendor/laravel/lumen-framework/src/Exceptions/Handler.php:109
  at Laravel\Lumen\Exceptions\Handler->render()
     (/var/www/cvandaag/app/Exceptions/Handler.php:93)
  at App\Exceptions\Handler->render()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:72)
  at Laravel\Lumen\Routing\Pipeline->handleException()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:50)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}()
     (/var/www/cvandaag/app/Http/Middleware/AddHeaderAccessToken.php:22)
  at App\Http\Middleware\AddHeaderAccessToken->handle()
     (/var/www/cvandaag/vendor/illuminate/pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}()
     (/var/www/cvandaag/app/Http/Middleware/CorsMiddleware.php:27)
  at App\Http\Middleware\CorsMiddleware->handle()
     (/var/www/cvandaag/vendor/illuminate/pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}()
     (/var/www/cvandaag/vendor/illuminate/pipeline/Pipeline.php:103)
  at Illuminate\Pipeline\Pipeline->then()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:426)
  at Laravel\Lumen\Application->sendThroughPipeline()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:175)
  at Laravel\Lumen\Application->dispatch()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:112)
  at Laravel\Lumen\Application->run()
     (/var/www/cvandaag/public/index.php:28)                
[1/2] ModelNotFoundException
Illuminate\Database\Eloquent\ModelNotFoundException:
No query results for model [App\Models\Ad] 28

  at /var/www/cvandaag/vendor/illuminate/database/Eloquent/Builder.php:444
  at Illuminate\Database\Eloquent\Builder->findOrFail()
     (/var/www/cvandaag/vendor/illuminate/support/Traits/ForwardsCalls.php:23)
  at Illuminate\Database\Eloquent\Model->forwardCallTo()
     (/var/www/cvandaag/vendor/illuminate/database/Eloquent/Model.php:2132)
  at Illuminate\Database\Eloquent\Model->__call()
     (/var/www/cvandaag/vendor/illuminate/database/Eloquent/Model.php:2144)
  at Illuminate\Database\Eloquent\Model::__callStatic()
     (/var/www/cvandaag/app/Http/Controllers/AdvertiseDeliverController.php:63)
  at App\Http\Controllers\AdvertiseDeliverController->click()
     (/var/www/cvandaag/vendor/illuminate/container/BoundMethod.php:36)
  at Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
     (/var/www/cvandaag/vendor/illuminate/container/Util.php:40)
  at Illuminate\Container\Util::unwrapIfClosure()
     (/var/www/cvandaag/vendor/illuminate/container/BoundMethod.php:93)
  at Illuminate\Container\BoundMethod::callBoundMethod()
     (/var/www/cvandaag/vendor/illuminate/container/BoundMethod.php:37)
  at Illuminate\Container\BoundMethod::call()
     (/var/www/cvandaag/vendor/illuminate/container/Container.php:653)
  at Illuminate\Container\Container->call()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:389)
  at Laravel\Lumen\Application->callControllerCallable()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:355)
  at Laravel\Lumen\Application->callLumenController()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:329)
  at Laravel\Lumen\Application->callControllerAction()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:282)
  at Laravel\Lumen\Application->callActionOnArrayBasedRoute()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:267)
  at Laravel\Lumen\Application->handleFoundRoute()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:237)
  at Laravel\Lumen\Application->handleDispatcherResponse()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:173)
  at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:48)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}()
     (/var/www/cvandaag/app/Http/Middleware/AddHeaderAccessToken.php:22)
  at App\Http\Middleware\AddHeaderAccessToken->handle()
     (/var/www/cvandaag/vendor/illuminate/pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}()
     (/var/www/cvandaag/app/Http/Middleware/CorsMiddleware.php:27)
  at App\Http\Middleware\CorsMiddleware->handle()
     (/var/www/cvandaag/vendor/illuminate/pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}()
     (/var/www/cvandaag/vendor/illuminate/pipeline/Pipeline.php:103)
  at Illuminate\Pipeline\Pipeline->then()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:426)
  at Laravel\Lumen\Application->sendThroughPipeline()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:175)
  at Laravel\Lumen\Application->dispatch()
     (/var/www/cvandaag/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:112)
  at Laravel\Lumen\Application->run()
     (/var/www/cvandaag/public/index.php:28)