{
$produtos = DB::table('produtos')->where('categoria_slug', $slug)->where('ativo', 1)->orderby('posicao', 'asc')->paginate(15);
//$produtos = DB::table('produtos')->where('ativo', 1)->get();
$categoria = DB::table('produtos')->where('categoria_slug', $slug)->first()->categoria;
return View::make('paginas.produtos')->with('produtos', $produtos)->with('categoria', $categoria);
{
$produtos = DB::table('produtos')->where('categoria_slug', $slug)->where('ativo', 1)->orderby('posicao', 'asc')->paginate(15);
//$produtos = DB::table('produtos')->where('ativo', 1)->get();
$categoria = DB::table('produtos')->where('categoria_slug', $slug)->first()->categoria;
return View::make('paginas.produtos')->with('produtos', $produtos)->with('categoria', $categoria);
*
* @param string $method
* @param array $parameters
* @return mixed
*/
protected function callMethod($method, $parameters)
{
return call_user_func_array(array($this, $method), $parameters);
}
// after filters on the controller to wrap up any last minute processing.
$response = $this->callBeforeFilters($router, $method);
$this->setupLayout();
if (is_null($response))
{
$response = $this->callMethod($method, $parameters);
}
$ioc = $this->container;
$me = $this;
return function () use($me, $ioc, $attribute) {
list($controller, $method) = explode('@', $attribute);
$route = $me->getCurrentRoute();
$args = array_values($route->getParametersWithoutDefaults());
$instance = $ioc->make($controller);
return $instance->callAction($ioc, $me, $method, $args);
};
}
$this->callAfterFilters($request, $response);
}
return $response;
}
protected function callCallable()
{
$variables = array_values($this->getParametersWithoutDefaults());
return call_user_func_array($this->getOption('_call'), $variables);
}
protected function callBeforeFilters(Request $request)
protected $parameters;
protected $parsedParameters;
public function run(Request $request)
{
$this->parsedParameters = null;
$response = $this->callBeforeFilters($request);
if (!isset($response)) {
$response = $this->callCallable();
} else {
$fromFilter = true;
{
$this->currentRequest = $request;
$response = $this->callGlobalFilter($request, 'before');
if (!is_null($response)) {
$response = $this->prepare($response, $request);
} else {
$this->currentRoute = $route = $this->findRoute($request);
$response = $route->run($request);
}
$this->callAfterFilter($request, $response);
}
public function dispatch(Request $request)
{
if ($this->isDownForMaintenance()) {
$response = $this['events']->until('illuminate.app.down');
return $this->prepareResponse($response, $request);
} else {
return $this['router']->dispatch($this->prepareRequest($request));
}
}
$this->fireAppCallbacks($this->shutdownCallbacks);
} else {
$this->shutdownCallbacks[] = $callback;
}
}
public function run()
{
$response = $this->dispatch($this['request']);
$this['router']->callCloseFilter($this['request'], $response);
$response->send();
| Once we have the application, we can simply call the run method,
| which will execute the request and send the response back to
| the client's browser allowing them to enjoy the creative
| and wonderful applications we have created for them.
|
*/
$app->run();
/*