"qr_url" => $campaign->qr_url ?? null, "url_clicks" => $campaign->url_clicks ?? 0, "qr_scans" => $campaign->qr_scans ?? 0, "label" => $campaign->label ?? '', "medium" => [ "label" => $campaign->medium_label, "code" => $campaign->medium_code ], "source" => [ "label" => $campaign->source_label, "code" => $campaign->source_code protected function registerErrorHandling() { error_reporting(-1); set_error_handler(function ($level, $message, $file = '', $line = 0) { $this->handleError($level, $message, $file, $line); }); set_exception_handler(function ($e) { $this->handleException($e); }); "qr_url" => $campaign->qr_url ?? null, "url_clicks" => $campaign->url_clicks ?? 0, "qr_scans" => $campaign->qr_scans ?? 0, "label" => $campaign->label ?? '', "medium" => [ "label" => $campaign->medium_label, "code" => $campaign->medium_code ], "source" => [ "label" => $campaign->source_label, "code" => $campaign->source_code ], [ 'source' => 'nullable|string', ]); //if($campaign = Campaign::where('code',$request->campaign_id)->first()){ if( $campaign = CacheController::get($request->campaign_id) ){ $campaign = Campaign::where('code',$request->campaign_id)->first(); $url = $campaign->full_url; $source = $request->src; if($request->src == 'qr'){ 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. * 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))); }); } /** * * @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(); } } if (count($middleware) > 0) { 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); // Pipe through route middleware... if (isset($action['middleware'])) { $middleware = $this->gatherMiddlewareClassNames($action['middleware']); return $this->prepareResponse($this->sendThroughPipeline($middleware, function () { return $this->callActionOnArrayBasedRoute($this['request']->route()); })); } return $this->prepareResponse( $this->callActionOnArrayBasedRoute($routeInfo) */ protected function prepareDestination(BaseClosure $destination) { return function ($passable) use ($destination) { try { return $destination($passable); } catch (Throwable $e) { return $this->handleException($passable, $e); } }; }// $redis->sadd($key,$content);// $redis->hset($key,$field,$content);// $redis->expire($key,$expiry); 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); } }; };class LogExecutionTime{ public function handle($request, Closure $next) { $startTime = microtime(true); $response = $next($request); $endTime = microtime(true); $executionTime = $endTime - $startTime; $requestName = $request->path(); $exploded_path = explode('/',$requestName); $category = match($exploded_path[0]){ // 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')); } // Pipe through route middleware... if (isset($action['middleware'])) { $middleware = $this->gatherMiddlewareClassNames($action['middleware']); return $this->prepareResponse($this->sendThroughPipeline($middleware, function () { return $this->callActionOnArrayBasedRoute($this['request']->route()); })); } return $this->prepareResponse( 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)); ->send($this->make('request')) ->through($middleware) ->then($then); } return $then($this->make('request')); } /** * Prepare the response for sending. * [$method, $pathInfo] = $this->parseIncomingRequest($request); try { $this->boot(); return $this->sendThroughPipeline($this->middleware, function ($request) use ($method, $pathInfo) { $this->instance(Request::class, $request); if (isset($this->router->getRoutes()[$method.$pathInfo])) { return $this->handleFoundRoute([true, $this->router->getRoutes()[$method.$pathInfo]['action'], []]); } * @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();|
ErrorException
|
|---|
ErrorException:
Undefined property: stdClass::$medium_label
at /var/www/backend/public_html/api/app/Http/Controllers/Administration/Campaigns/CacheController.php:99
at Laravel\Lumen\Application->handleError()
(/var/www/backend/public_html/api/vendor/laravel/lumen-framework/src/Concerns/RegistersExceptionHandlers.php:47)
at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}()
(/var/www/backend/public_html/api/app/Http/Controllers/Administration/Campaigns/CacheController.php:99)
at App\Http\Controllers\Administration\Campaigns\CacheController::get()
(/var/www/backend/public_html/api/app/Http/Controllers/Administration/Campaigns/CampaignsController.php:354)
at App\Http\Controllers\Administration\Campaigns\CampaignsController->getURL()
(/var/www/backend/public_html/api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36)
at Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
(/var/www/backend/public_html/api/vendor/laravel/framework/src/Illuminate/Container/Util.php:40)
at Illuminate\Container\Util::unwrapIfClosure()
(/var/www/backend/public_html/api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93)
at Illuminate\Container\BoundMethod::callBoundMethod()
(/var/www/backend/public_html/api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:35)
at Illuminate\Container\BoundMethod::call()
(/var/www/backend/public_html/api/vendor/laravel/framework/src/Illuminate/Container/Container.php:653)
at Illuminate\Container\Container->call()
(/var/www/backend/public_html/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:389)
at Laravel\Lumen\Application->callControllerCallable()
(/var/www/backend/public_html/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:354)
at Laravel\Lumen\Application->callLumenController()
(/var/www/backend/public_html/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:329)
at Laravel\Lumen\Application->callControllerAction()
(/var/www/backend/public_html/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:282)
at Laravel\Lumen\Application->callActionOnArrayBasedRoute()
(/var/www/backend/public_html/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:262)
at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}()
(/var/www/backend/public_html/api/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:48)
at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}()
(/var/www/backend/public_html/api/app/Http/Middleware/MonitorActivities.php:91)
at App\Http\Middleware\MonitorActivities->handle()
(/var/www/backend/public_html/api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
(/var/www/backend/public_html/api/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}()
(/var/www/backend/public_html/api/app/Http/Middleware/LogExecutionTime.php:14)
at App\Http\Middleware\LogExecutionTime->handle()
(/var/www/backend/public_html/api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167)
at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
(/var/www/backend/public_html/api/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}()
(/var/www/backend/public_html/api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103)
at Illuminate\Pipeline\Pipeline->then()
(/var/www/backend/public_html/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:426)
at Laravel\Lumen\Application->sendThroughPipeline()
(/var/www/backend/public_html/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:261)
at Laravel\Lumen\Application->handleFoundRoute()
(/var/www/backend/public_html/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:237)
at Laravel\Lumen\Application->handleDispatcherResponse()
(/var/www/backend/public_html/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:172)
at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}()
(/var/www/backend/public_html/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:429)
at Laravel\Lumen\Application->sendThroughPipeline()
(/var/www/backend/public_html/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:165)
at Laravel\Lumen\Application->dispatch()
(/var/www/backend/public_html/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:112)
at Laravel\Lumen\Application->run()
(/var/www/backend/public_html/api/public/index.php:28)
|