Posts by Jonathan Silva Gomes • 21 points
8 posts
-
0
votes1
answer141
viewsA: How to pass an array by ajax to the controller?
I managed to settle by making the following changes: I added [] in the name getting subunit[]: <div class="form-group"> {{ Form::select('subunidade[]', $subunidades, null, array('class' =>…
-
0
votes1
answer141
viewsQ: How to pass an array by ajax to the controller?
I have an ajax that sends data from my selects to my controller and from there I do a check and query, so far everything is working perfectly. The problem is that the last select that sends is an…
-
1
votes1
answer86
viewsQ: Checkbox value is null, Column 'situation' cannot be null
I have a field $table->enum('situacao', ['ativo', 'exonerado']);. I created a checkbox to register, but it returns the following error: 1048 Column 'situation' cannot be null. How can I solve?…
-
-1
votes4
answers1204
viewsA: Laravel - Function in Controller
I believe that only with the insertion of the function firstOrNew solves the problem. $certificado = certificado::firstOrNew(['id_evento' => $request->id_evento]); $certificado->id_evento =…
-
1
votes1
answer378
viewsA: Check if registration already exists, if there is only link
Thank you so much! I got it. The save() remains, I only had to exchange the first line for the firstOrNew, instead of $endereco = new endereco; placed: $endereco = endereco::firstOrNew(['cep' =>…
-
0
votes1
answer378
viewsQ: Check if registration already exists, if there is only link
I want to check if the address has already been registered, if it is already registered I just want to link it to a civilian, but if there is not yet want to register the new address and then link.…
-
0
votes1
answer139
viewsQ: Register N for 1 and N for N?
How can I register in a relationship 1-N and of N para M, I’m doing it this way, but it’s not cool: $endereco = new endereco; $endereco->complemento = $request->complemento;…
-
0
votes1
answer33
viewsQ: Error making the list
Trying to get Property of non-object: @foreach($civis as $civil) <tr> <td>01</td> <td>{{$civil->matricula}}</td> <td>{{$civil->nome}}</td>…