Laravel advanced search

Asked

Viewed 36 times

0

Mount table according to search

Good afternoon, people, it is possible to create a search and assemble a table according to the result

EXAMPLE

inserir a descrição da imagem aqui

public function envia(Request $request){
  $bcentrocusto = $request->get('c');
  $bunidade = $request->get('u');
  $bproduto = $request->get('p');

  if(isset($bcentrocusto, $bunidade, $bproduto)){
    echo 'v1';
    return Redirect::to(route('requisicao.index'));

  }elseif(isset($bunidade, $bproduto)){
    echo 'v2';
    return Redirect::to(route('solicitacao.index'));

  }elseif(isset($bunidade, $bproduto)){
    echo 'v3';
    return Redirect::to(route('compra.index'));
  }
}
  • 1

    Hello Frodrigues. Could you be more specific in your doubt? The way you’ve crafted your question makes it difficult to help you, it’s important that you show us what you’ve done and where your difficulty is. Here’s how to ask a question from an example

  • Thanks for the return William, I posted a model I made. The idea is as follows: According to the request I receive I mount the screen with filters. EX: if the user wants to filter by the three, give a report, if he wants with only two, mount and so on...

  • If that redirect within the if had worked it had solved, but it is not working. I thought of redirecting the view according to if. But I don’t know if that’s possible

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.