Symfony Exception

ErrorException

HTTP 500 Internal Server Error

Undefined variable: categorys

Exception

ErrorException

  1.             case "cdl-em-acao";
  2.                 $categorys CategoryNews::where('nome_categoria''CDL EM AÇÃO')->get();
  3.                 break;
  4.         }
  5.         $clime = [];
  6.         $allNews News::where('id_categoria_noticia'$categorys[0]->id_noticia_categoria)->orderBy('data_hora_entrada''desc')->paginate(10);
  7.         return view('app.secondary.allNews'compact('meta''slideshow''allNews''categorys''clime'));
  8.     }
  9. }
Application->Laravel\Lumen\Concerns\{closure}(8, 'Undefined variable: categorys', '/home/cdlmontecarmelo/public_html/novo/app/Http/Controllers/NewsController.php', 63, array('slug' => 'novo-horario-de-funcionamento-da-cdl', 'meta' => object(MetaConfig), 'slideshow' => array(), 'clime' => array())) in /home/cdlmontecarmelo/public_html/novo/app/Http/Controllers/NewsController.php (line 63)
  1.             case "cdl-em-acao";
  2.                 $categorys CategoryNews::where('nome_categoria''CDL EM AÇÃO')->get();
  3.                 break;
  4.         }
  5.         $clime = [];
  6.         $allNews News::where('id_categoria_noticia'$categorys[0]->id_noticia_categoria)->orderBy('data_hora_entrada''desc')->paginate(10);
  7.         return view('app.secondary.allNews'compact('meta''slideshow''allNews''categorys''clime'));
  8.     }
  9. }
NewsController->filter('novo-horario-de-funcionamento-da-cdl')
  1.             return static::callClass($container$callback$parameters$defaultMethod);
  2.         }
  3.         return static::callBoundMethod($container$callback, function () use ($container$callback$parameters) {
  4.             return call_user_func_array(
  5.                 $callback, static::getMethodDependencies($container$callback$parameters)
  6.             );
  7.         });
  8.     }
  9.     /**
  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::callBoundMethod($container$callback, function () use ($container$callback$parameters) {
  2.             return call_user_func_array(
  3.                 $callback, static::getMethodDependencies($container$callback$parameters)
  4.             );
  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.                 ->send($this->make('request'))
  2.                 ->through($middleware)
  3.                 ->then($then);
  4.         }
  5.         return $then($this->make('request'));
  6.     }
  7.     /**
  8.      * Prepare the response for sending.
  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  SymfonyRequest|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;
  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 Trace

ErrorException

ErrorException:
Undefined variable: categorys

  at /home/cdlmontecarmelo/public_html/novo/app/Http/Controllers/NewsController.php:63
  at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(8, 'Undefined variable: categorys', '/home/cdlmontecarmelo/public_html/novo/app/Http/Controllers/NewsController.php', 63, array('slug' => 'novo-horario-de-funcionamento-da-cdl', 'meta' => object(MetaConfig), 'slideshow' => array(), 'clime' => array()))
     (/home/cdlmontecarmelo/public_html/novo/app/Http/Controllers/NewsController.php:63)
  at App\Http\Controllers\NewsController->filter('novo-horario-de-funcionamento-da-cdl')
  at call_user_func_array(array(object(NewsController), 'filter'), array('novo-horario-de-funcionamento-da-cdl'))
     (/home/cdlmontecarmelo/public_html/novo/vendor/illuminate/container/BoundMethod.php:37)
  at Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
     (/home/cdlmontecarmelo/public_html/novo/vendor/illuminate/container/Util.php:37)
  at Illuminate\Container\Util::unwrapIfClosure(object(Closure))
     (/home/cdlmontecarmelo/public_html/novo/vendor/illuminate/container/BoundMethod.php:95)
  at Illuminate\Container\BoundMethod::callBoundMethod(object(Application), array(object(NewsController), 'filter'), object(Closure))
     (/home/cdlmontecarmelo/public_html/novo/vendor/illuminate/container/BoundMethod.php:39)
  at Illuminate\Container\BoundMethod::call(object(Application), array(object(NewsController), 'filter'), array('slug' => 'novo-horario-de-funcionamento-da-cdl'), null)
     (/home/cdlmontecarmelo/public_html/novo/vendor/illuminate/container/Container.php:596)
  at Illuminate\Container\Container->call(array(object(NewsController), 'filter'), array('slug' => 'novo-horario-de-funcionamento-da-cdl'))
     (/home/cdlmontecarmelo/public_html/novo/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:386)
  at Laravel\Lumen\Application->callControllerCallable(array(object(NewsController), 'filter'), array('slug' => 'novo-horario-de-funcionamento-da-cdl'))
     (/home/cdlmontecarmelo/public_html/novo/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:352)
  at Laravel\Lumen\Application->callLumenController(object(NewsController), 'filter', array(1, array('uses' => 'App\\Http\\Controllers\\NewsController@filter'), array('slug' => 'novo-horario-de-funcionamento-da-cdl')))
     (/home/cdlmontecarmelo/public_html/novo/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:326)
  at Laravel\Lumen\Application->callControllerAction(array(1, array('uses' => 'App\\Http\\Controllers\\NewsController@filter'), array('slug' => 'novo-horario-de-funcionamento-da-cdl')))
     (/home/cdlmontecarmelo/public_html/novo/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:279)
  at Laravel\Lumen\Application->callActionOnArrayBasedRoute(array(1, array('uses' => 'App\\Http\\Controllers\\NewsController@filter'), array('slug' => 'novo-horario-de-funcionamento-da-cdl')))
     (/home/cdlmontecarmelo/public_html/novo/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:264)
  at Laravel\Lumen\Application->handleFoundRoute(array(1, array('uses' => 'App\\Http\\Controllers\\NewsController@filter'), array('slug' => 'novo-horario-de-funcionamento-da-cdl')))
     (/home/cdlmontecarmelo/public_html/novo/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:234)
  at Laravel\Lumen\Application->handleDispatcherResponse(array(1, array('uses' => 'App\\Http\\Controllers\\NewsController@filter'), array('slug' => 'novo-horario-de-funcionamento-da-cdl')))
     (/home/cdlmontecarmelo/public_html/novo/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:170)
  at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(object(Request))
     (/home/cdlmontecarmelo/public_html/novo/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:426)
  at Laravel\Lumen\Application->sendThroughPipeline(array(), object(Closure))
     (/home/cdlmontecarmelo/public_html/novo/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:172)
  at Laravel\Lumen\Application->dispatch(null)
     (/home/cdlmontecarmelo/public_html/novo/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:109)
  at Laravel\Lumen\Application->run()
     (/home/cdlmontecarmelo/public_html/novo/public/index.php:28)