Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

485
Visualizações
Laravel Collective Form checkbox always checked

I'm using Laravel Collective for Forms and having an issue with checkbox.

Here is what I'm doing :

{!! Form::checkbox('independent',null,['class'=>'form-control', 'required' => 'required'])!!}

I've tried changing values for "null", added one more parameters as suggested by many while googling for solution but nothing seems to be working.

If anyone know the solution or having same issue, please share.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The documentation states that the third parameter is a boolean that determines if the checkbox is checked, you have an array as the third parameter. Php interprets an array as true, this is why your checkbox is always checked.

You should add true or false as the third parameter and add the options array as a fourth parameter. This can be found in the source code on GitHub.

{!! Form::checkbox('independent', null, false) !!}
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda