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