I am starting to learn Laravel and still on the learning curve. Now I start with Laravel 3, but most likely I will switch my project to Laravel 4 as soon as I get something working. Now the question is how to check the flag array, I want to check that at least 1 inside the group is enabled (checked). I read somewhere on the Laravel forum that we just check them using the required, but when I dd(input::all())
, I see nothing but the input field and the checkbox are not part of them ...
Part of my blade Create code for the flag:
<label class="checkbox">{{ Form::checkbox('changeReasons[]', 'ckbCRCertification', Input::had('ckbCRCertification'), array('id' => 'ckbCRCertification')) }} Certification</label> <label class="checkbox">{{ Form::checkbox('changeReasons[]', 'ckbCRDesignCorrection', Input::had('ckbCRDesignCorrection'), array('id' => 'ckbCRDesignCorrection')) }} Design Correction</label>
My controller code (REST):
public function post_create() { print "Inside the post_create()";
I also want to know the correct code to get the status of the checkboxes after the check failed, I thought I saw Input::had(checkBoxName)
somewhere, but this does not seem to work, maybe I am not using it correctly I got a little confused about this because the whole example that I see is for input and nothing else. I assume that validation is about the same in L4, right?
source share