Questions tagged as 'laravel-eloquent'

1
answer

Laravel 5 Eloquent View Blade with Foreign Key?

I get the following error:    Trying to get property 'name' of non-object I have a list of Suppliers and Payments, and I am using the following syntax to retrieve the Vendor name through the foreign key of the payments. <td>{{$pag...
asked by 05.02.2018 / 16:56
0
answers

Pass Controller data to a modal in Laravel view 5.5

I'm trying to pass data from a Controller to a Modal in the view. In the view I have this code that populates a datatable as soon as the page is loaded: .... @foreach($exames as $exame) <tr>...
asked by 29.01.2018 / 00:17
1
answer

Error writing a collection of checkboxes

Live, I'm using laravel 5.1 and after submitting a form that has a collection of checkboxes array:3 [▼ 0 => "24" 1 => "26" 2 => "32" ] I write the record and then in a related table I insert the record block if( $auto-&g...
asked by 01.02.2018 / 03:25
1
answer

How to make several separate selects with laravel 4.2?

Hello, I need to do a select in a table, but if I do not receive the month by the parameter I must do the SUM method to sum every month if($month != 0){ $dbRegister = tb_data::selectRaw('tb_data.total_points'); }else{...
asked by 26.01.2018 / 15:06
1
answer

Laravel, problem with Float fields

Hello, I'm using Laravel and I need to do a select in a table, I also create a field that brings the result of a function. My select looks like this: return \DB::table("view_pins_ocorrencias") ->select("*", "round(geo({$d...
asked by 17.01.2018 / 17:03
0
answers

How to save multiple inputs with the same name in Laravel?

How to save multiple inputs with the same name in Laravel ? {!! Form::text('dependente[]', null, ['class' => 'form-control']); !!} {!! Form::text('dependente[]', null, ['class' => 'form-control']); !!} {!! Form::text('dependente[...
asked by 10.01.2018 / 14:15
1
answer

Many relationship to many laravel

Well, I've tried to read the documentation and develop this relationship, but I can not really tell you what the user's name is. The database model looks like this: % of% involved App\User App\TipoUser App\UserTipo And in my model i...
asked by 04.05.2017 / 01:45
1
answer

Check if record already exists, if already exists just 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 it does not already exist I want to register the new address and then link. The relationship is 1 civilian has O...
asked by 21.12.2017 / 17:08
1
answer

Error in making listing

Trying to get property of non-object: @foreach($civis as $civil) <tr> <td>01</td> <td>{{$civil->matricula}}</td> <td>{{$civil...
asked by 18.12.2017 / 17:15
1
answer

Register N for 1 and N for N?

How do I sign up for a relationship 1 for N and N for M , I am doing this but : $endereco = new endereco; $endereco->complemento = $request->complemento; $endereco->logradouro = $request->logradouro; $endereco->bairro = $r...
asked by 18.12.2017 / 20:55