marcellopato

marcellopato

CEO at AHCME

Member Since 2 Years Ago

São Paulo

Experience Points
24,140
Total
Experience

860 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
195
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 5
24,140 XP
Nov
21
3 weeks ago
Activity icon

Replied to Trying To Get Property 'email' Of Non-object

LOL... Yes, I should. Sorry to bother you guys and thanks for your help, anyways

Activity icon

Awarded Best Reply on Trying To Get Property 'email' Of Non-object

I AM AN DONKEY! It happens when the user doesn´t input his email at email input. Sorry guys, Mea Culpa

Activity icon

Replied to Trying To Get Property 'email' Of Non-object

I AM AN DONKEY! It happens when the user doesn´t input his email at email input. Sorry guys, Mea Culpa

Activity icon

Replied to Trying To Get Property 'email' Of Non-object

Oh man, sorry... this the default Laravel´s Mail page... the one which does the magic... As I said, it was working good and then, from day to another...

Activity icon

Replied to Invalid Datetime Format: 1292 Truncated Incorrect DOUBLE

Not that I can recall... well, let´s see what happens in a couple of days!

Activity icon

Started a new Conversation Trying To Get Property 'email' Of Non-object

Today is the 'stop working things'. I was sending emails like a boss and then, suddenly, without any reason, it ´s working bad.

Trying to get property 'email' of non-object

That´s the line with error:

protected function setAddress($address, $name = null, $property = 'to')
    {
        foreach ($this->addressesToArray($address, $name) as $recipient) {
            $recipient = $this->normalizeRecipient($recipient);
 
            $this->{$property}[] = [
                'name' => $recipient->name ?? null,
                'address' => $recipient->email,
            ];
        }
 
        return $this;
    }

The email is sent normally, but now this error appears. Why could it possibly be?

Activity icon

Replied to Invalid Datetime Format: 1292 Truncated Incorrect DOUBLE

Works! But why it was working and suddenly, without any changes, it stopped?

Activity icon

Started a new Conversation Invalid Datetime Format: 1292 Truncated Incorrect DOUBLE

SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: '######' (SQL: update `contratos` set `disponivel` = 1, `contratos`.`updated_at` = 2019-11-21 14:44:41 where `contrato` = 12038)

It was working fine until today and I don´t know why it just stopped.

Let´s see some code:

 public function index(Request $request)
    {
        // dd($request);
        $con = $request->contrato;
        $total = 0;
        foreach ($con as $key => $value) {
            $contratos[$key] = $key;
            $total += $value;
            Contrato::where('contrato', '=', $key)
                ->update([
                    'disponivel' => 1,
                ]);
        }
        $contemplado = User::where('id', '=', $request->user_id)->first();
        $contrato = Contrato::where('user_id', '=', $contemplado->id)->first(); // PRECISA LEVAR SÓ O CONTRATO DA COTA SELECIONADA
        $grupo = $contrato->grupo;
        return view('contemplado.mono')
            ->withContratos($contratos)
            ->withGrupo($contrato)
            ->withContemplado($contemplado)
            ->withGrupo($grupo)
            ->withTotal($total);
    }

I can´t figure out why it is happening and why it stopped just like that...

Any helps?

Thank´s in advance!

Nov
06
1 month ago
Activity icon

Replied to How To Pass Pre Data To A View??

Worked casting as an object! It is amazing how such an easy thing can be so difficult sometimes...

Activity icon

Replied to How To Pass Pre Data To A View??

Roger that. The problem is that I want to reuse a view which is already ruled by another controller. I think will be better to write a new page to do the job...

Activity icon

Replied to How To Pass Pre Data To A View??

My view is already used by another controller, so I´d rather not change view witch looks like:

<div class="etapas float-right">
                    @if($contrato->pessoa == 'F')
                    <div class="float-right m-t-25 badge badge-pill badge-secondary" v-if="imprime == true"><a
                            class="text-white" :href="'/print_docs_pf/'+renda"><i aria-hidden="true"
                                class="fa fa-print"></i> Imprimir essa lista</a></div>
                    @else
                    <div class="float-right m-t-25 badge badge-pill badge-secondary" v-if="imprime == true"><a
                            class="text-white" :href="'/print_docs_pj/'+renda"><i aria-hidden="true"
                                class="fa fa-print"></i> Imprimir essa lista</a></div>
                    @endif
                </div>

I´m pretty sure it is something really easy and that´s why I can´t figure it out. 'Shoot', I hate when it happens!

Activity icon

Replied to How To Pass Pre Data To A View??

It is not working...

Trying to get property 'pessoa' of non-object (View: /Users/marcellopato/Sites/primorossi/resources/views/contemplado/uploads.blade.php)

:-(

Activity icon

Started a new Conversation How To Pass Pre Data To A View??

Hello folks!

I want to pass some predetermined data to a view, but don´t know how to do it. For example:

$contrato = [
                'contrato' => 0,
                'pessoa' => 'F',
                ''
            ];

...


return view('contemplado.uploads')
->withContrato($contrato)

Any ideas, please?

Oct
31
1 month ago
Activity icon

Replied to Foreach Loop With Sum

I am an active member of Laracasts already! I´ll look into it!

Best Regards, dude! ;-)

Activity icon

Replied to Foreach Loop With Sum

Cool! It is awesome! I need to learn more about arrays... do You know some books about it?

And again, THANKS A LOT!

Activity icon

Replied to Foreach Loop With Sum

Sorry to bother you with this subject, but I´m kinda dumb about arrays...

How do I use this in the view? How can I show a list of $contratos? (Or not. Maybe the user chooses just one)

I did a dd($contratos) to see what is in the $contratos variable, but came just ONE item inside a array:


array:1 [▼
  0 => array:1 [▼
    859866 => "12975"
  ]

Again, thanks in advance!

Activity icon

Replied to Foreach Loop With Sum

Roger that! Thanks. I am trying to show something like this in the view:

@foreach ($contratos as $contrato)
    Select contract: {{ $contrato->contrato }}
@endforeach

<hr>

Total: {{ $total }}

But only one item is shown. Maybe the first or the last... why is that?

Activity icon

Started a new Conversation Foreach Loop With Sum

Hy folks!

I have this request to a controller:

$(nTd).html(
                                "<div class='form-check'><input class='form-check-input' type='checkbox' name='contrato[" + oData['NUMERO-CONTRATO'] + "]' value='" + oData['VALOR-BEM'] + "'></div>")

At the controller I have:

$con = $request->contrato;
        foreach ($con as $key => $value) {
            $contratos = [
                $key => $value,
            ];
        }

return view('contemplado.mono')
            ->withContratos($contratos);

Now I want to sum $value on the view, like:

@foreach ($contratos as $contrato)
                   Contrato selecionado: {{ $contrato->contrato }}, valor R${{ $contrato->valor }}<br>
               @endforeach

$total = $contrato->valor 

*I know it is wrong, but I can´t figure out how it is the right way to do it... Some help, please! But it is not working...

Oct
29
1 month ago
Activity icon

Replied to How Can I Find If Json Has An Email?

That´s how my code looks right now:

$socioFiador = Socio::where('user_id', '=', Auth::user()->id)->first();
            $socios = $socioFiador->socios;
            $data = collect(json_decode($socios, true));
            $emails = $data->filter(function ($object) {
                return isset($object->fiador) && $object->fiador == 1;
            })
                ->map(function ($object) {
                    return $object['eMail'];
                })
                ->toArray();

            dd($emails);

A mix of what I got from all your answers, but the result is an empty '[]'

Am I so dumb that can´t figure it?

Activity icon

Replied to How Can I Find If Json Has An Email?

Something is missing... got this error:

Undefined property: stdClass::$fiador

I dd() after first line...-> ok It got lost on $object->fiador

Activity icon

Replied to How Can I Find If Json Has An Email?

First of all, thanks for your answer. Is this PHP os JS? I need to do it in PHP, please...

Activity icon

Started a new Conversation How Can I Find If Json Has An Email?

Hello folks,

I have this response, which I believe is a JSON:

[
{
"nome": "ELIANA CRISTINA GUILHERMITTI RODRIGUES - 49-Sócio-Administrador",
"eMail": null,
"cpf": "132.555.555-56",
"rg": "55.555.555-5",
"orgaoExp": "SSP"
},
{
"nome": "SUZANA MARQUES LOBANCO - 49-Sócio-Administrador",
"fiador": "1",
"eMail": "[email protected]",
"cpf": "132.555.555-55",
"rg": "12.121.212-1",
"orgaoExp": "SSP"
},
{
"nome": "AMARILDO APARECIDO RODRIGUES - 49-Sócio-Administrador",
"eMail": null,
"cpf": null,
"rg": null,
"orgaoExp": null
},
{
"nome": "VALDEMIR FRANCISCO DA COSTA - 22-Sócio",
"eMail": null,
"cpf": null,
"rg": null,
"orgaoExp": null
},
{
"nome": "ANDRE LUIS LOBANCO - 49-Sócio-Administrador",
"eMail": null,
"cpf": null,
"rg": null,
"orgaoExp": null
}
]

Now I want to grab only the email where the word 'fiador: 1', but I have no clue on how to do it...

Anyone, please?

Oct
28
1 month ago
Activity icon

Replied to Eloquent Relationships. How Does It Really Works?

Now, just for a big understanding, that´s the result:

public function listaAnalises()
    {
        $analises = Analise::with(['user', 'contrato'])->get();
        $result = DataTables::of($analises)->toJson();
        return $result;
    }

As I am using DataTables in Voyager, the script become as:

<script>
    var app = new Vue({
        el: '#app',
        mounted() {
            const vm = this
                var tabela = $('#example').dataTable({
                    "language": {
                        'url': '//cdn.datatables.net/plug-ins/1.10.16/i18n/Portuguese-Brasil.json'
                    },
                    'scrollX': true,
                    'scrollY': false,
                    'autoWidth': true,
                    responsive: true,
                    processing: true,
                    "ajax": {
                        "url": "listaAnalises",
                        "method": "get",
                        "data": {
                            "user_id": {{ Auth::user()->id }}
                        }
                    },
                    columns: [
                        { data: 'user.name'},
                        { data: 'contrato.contrato'},
                        { data: 'created_at',
                                fnCreatedCell: function (nTd, sData, oData, iRow, iCol) {
                                moment.locale('pt-br');
                                var data = oData['created_at'];
                                let criado = moment(data, 'YYYYMMDD').fromNow();
                                    $(nTd).html(criado);
                            }
                        },
                        { data: null,
                            fnCreatedCell: function (nTd, sData, oData, iRow, iCol) {
                                $(nTd).html('<a href="analises/'+oData['id']+'"><i class="fas fa-eye"></i></a>')
                            }
                        },
                    ]
                });
        }
    });
</script>

Now, on the view, I got the name of the user and his contract number.

Thanks, again to @henriquesalvan and every one of you who gave me a hand!

Activity icon

Replied to Eloquent Relationships. How Does It Really Works?

Perfeito! É incrível como algo tão simples chega a ser difícil, não é verdade? Esse eloquent é muito bom mesmo! Obrigado pelas dicas @henriquesalvan

*Perfect! It is amazing how such a simple thing can be so difficult to understand sometimes, isn´t? But Eloquent is something really cool.

Oct
25
1 month ago
Activity icon

Replied to Eloquent Relationships. How Does It Really Works?

Sorry folks, but I´ll try to solve in portuguese with my pal @henriquesalvan

Henrique, é o seguinte: Eu tenho uma tabela para contratos (com user_id), a users e a tabela analises com user_id e contrato_id. Eu estou fazendo a consulta na tabela analises, que só tem ids das outras, certo?

Então, eu quero mostrar na tela o nome do user e o número do contrato e tenho que ter o id da analise para poder colocar no link.

A tabela analises então, guarda somente ids, como se fosse uma pivot, mas não é, entende?

Espero que tenha conseguido me expressa melhor agora ;-)

By the way, esse é o resultado dd($current)

Analise {#635
  #connection: "mysql"
  #table: "analises"
  #primaryKey: "id"
  #keyType: "int"
  +incrementing: true
  #with: []
  #withCount: []
  #perPage: 15
  +exists: true
  +wasRecentlyCreated: false
  #attributes: array:6 [
    "id" => 1
    "user_id" => 294
    "contrato_id" => 1
    "finalizado" => 0
    "created_at" => "2019-10-24 12:58:37"
    "updated_at" => "2019-10-24 12:58:37"
  ]
  #original: array:6 [
    "id" => 1
    "user_id" => 294
    "contrato_id" => 1
    "finalizado" => 0
    "created_at" => "2019-10-24 12:58:37"
    "updated_at" => "2019-10-24 12:58:37"
  ]
  #changes: []
  #casts: []
  #dates: []
  #dateFormat: null
  #appends: []
  #dispatchesEvents: []
  #observables: []
  #relations: array:2 [
    "user" => User {#631
      #fillable: array:3 [
        0 => "name"
        1 => "cpfCnpj"
        2 => "password"
      ]
      #hidden: array:2 [
        0 => "password"
        1 => "remember_token"
      ]
      #casts: array:1 [
        "email_verified_at" => "datetime"
      ]
      #guarded: []
      +additional_attributes: array:1 [
        0 => "locale"
      ]
      #connection: "mysql"
      #table: "users"
      #primaryKey: "id"
      #keyType: "int"
      +incrementing: true
      #with: []
      #withCount: []
      #perPage: 15
      +exists: true
      +wasRecentlyCreated: false
      #attributes: array:52 [
        "id" => 294
        "role_id" => 2
        "name" => "AUTO ESCOLA GUILHERMITTI E L LTDA"
        "email" => "[email protected]"
        "avatar" => "users/default.png"
        "email_verified_at" => null
        "password" => "y$m3PrwsddB3aGlryR.0HLmOjtO0ONthE4KMBZ5V3Weyg8/tPimcwVG"
        "remember_token" => null
        "settings" => null
        "cc" => null
        "unidade" => null
        "matricula" => null
        "departamento" => null
        "equipe" => null
        "cep" => null
        "cargo" => null
        "uf" => null
        "telefoneComercial" => null
        "celular_comercial" => null
        "telefone" => null
        "nascimento" => null
        "seriePagSeguro" => null
        "senhaMaquininha" => null
        "numeroArmario" => null
        "precisaAssEletronica" => null
        "whatsapp" => null
        "novaAssinatura" => null
        "cpfCnpj" => "00635344000177"
        "IE" => null
        "estado_civil_id" => null
        "renda" => 4
        "tipoBeneficio" => null
        "numeroBeneficio" => null
        "tempoBeneficio" => null
        "atividade_principal" => "85.99-6-01"
        "atividades_secundarias" => "00.00-0-00 | Não informada"
        "capital_social" => null
        "data_situacao" => null
        "data_situacao_especial" => null
        "fantasia" => "Moto Guigo"
        "motivo_situacao" => "ATIVA"
        "natureza_juridica" => null
        "porte" => "MICRO EMPRESA"
        "status" => "OK"
        "tipo" => null
        "ultima_atualizacao" => null
        "receita" => "0.00"
        "idERP" => 1
        "sms" => null
        "adesao" => "02/06/1995"
        "created_at" => "2019-10-24 12:54:45"
        "updated_at" => "2019-10-24 13:46:05"
      ]
      #original: array:52 [
        "id" => 294
        "role_id" => 2
        "name" => "AUTO ESCOLA GUILHERMITTI E L LTDA"
        "email" => "[email protected]"
        "avatar" => "users/default.png"
        "email_verified_at" => null
        "password" => "y$m3PrwsddB3aGlryR.0HLmOjtO0ONthE4KMBZ5V3Weyg8/tPimcwVG"
        "remember_token" => null
        "settings" => null
        "cc" => null
        "unidade" => null
        "matricula" => null
        "departamento" => null
        "equipe" => null
        "cep" => null
        "cargo" => null
        "uf" => null
        "telefoneComercial" => null
        "celular_comercial" => null
        "telefone" => null
        "nascimento" => null
        "seriePagSeguro" => null
        "senhaMaquininha" => null
        "numeroArmario" => null
        "precisaAssEletronica" => null
        "whatsapp" => null
        "novaAssinatura" => null
        "cpfCnpj" => "00635344000177"
        "IE" => null
        "estado_civil_id" => null
        "renda" => 4
        "tipoBeneficio" => null
        "numeroBeneficio" => null
        "tempoBeneficio" => null
        "atividade_principal" => "85.99-6-01"
        "atividades_secundarias" => "00.00-0-00 | Não informada"
        "capital_social" => null
        "data_situacao" => null
        "data_situacao_especial" => null
        "fantasia" => "Moto Guigo"
        "motivo_situacao" => "ATIVA"
        "natureza_juridica" => null
        "porte" => "MICRO EMPRESA"
        "status" => "OK"
        "tipo" => null
        "ultima_atualizacao" => null
        "receita" => "0.00"
        "idERP" => 1
        "sms" => null
        "adesao" => "02/06/1995"
        "created_at" => "2019-10-24 12:54:45"
        "updated_at" => "2019-10-24 13:46:05"
      ]
      #changes: []
      #dates: []
      #dateFormat: null
      #appends: []
      #dispatchesEvents: []
      #observables: []
      #relations: []
      #touches: []
      +timestamps: true
      #visible: []
      #rememberTokenName: "remember_token"
    }
    "contract" => null
  ]
  #touches: []
  +timestamps: true
  #hidden: []
  #visible: []
  #fillable: []
  #guarded: array:1 [
    0 => "*"
  ]
}
Activity icon

Replied to Where Are You All From?

Brazil, São Paulo

Activity icon

Replied to Eloquent Relationships. How Does It Really Works?

Thank you all guys! @henriquesalvan (Sim, sou brasileiro ;-))

Actually, you all have clarified to me on this matter. But I think I need a little more help.

In my Analysis model I did:

    public function user()
    {
        return $this->hasOne('App\user', 'id', 'user_id');
    }

In my User model:


    public function analysis()
    {
        return $this->hasMany('App\Analysis', 'user_id', 'id');
    }

And it works like a breeze. But I need to pass more data from Analisys, like:

id <- that´s what I send by email to the analyst created_at <- that´s also for analyst´s controller user->name <- that´s what you guys has thought me and contract number, not its id.

So, it should look like this?

    public function listaAnalises()
    {
        $an = Analise::all();
        foreach ($an as $analises) {
            $analises->user->name;
        }
        $ct = Contrato::all();
        foreach ($ct as $contrato) {
            $contrato->contrato;
        }

        $result = DataTables::of($an)->toJson();
        return $result;
    }

Kind of, right? How do I´ll pass id, user->name, contrato->number, created_at encapsulated on $result variable that can be handled by DataTables?

Thanks!

Activity icon

Started a new Conversation Eloquent Relationships. How Does It Really Works?

I don´t think I have completely understood Eloquent Relationships. I need to make a relationship between User and Analysis. One user can have more than one analysis and I can have more than one analyst. It is like a credit analysis.

On the analysis table, I record only id´s, like:

id | user_id | contract_id | analysed | created_at | updated_at

I want to display on a DataTables component all the analysis created, but want to show the name of the User, instead of his id.

How can I do it?

Thanks in advance.

Oct
23
1 month ago
Activity icon

Started a new Conversation SOAP Not Working Anymore, Why?

I have this app that works making some requests via SOAP. Suddenly, without knowing why, it stops working and that is the error message:

SoapClient::SoapClient(): 'location' and 'uri' options are required in nonWSDL mode

Oh, now I remember, I have updated my Ubuntu at amazon. Well, if it is the issue, what can I do to solve this? Really don´t wanna reset everything and start all over again...

Oct
16
2 months ago
Activity icon

Replied to Why It Is Not Working?

I found the same record twice at the data table. Deleted. It is working. WTF*** ?

Well, thank you all for your good help!

Activity icon

Replied to Why It Is Not Working?

HELP!!!!

Activity icon

Replied to Why It Is Not Working?

This is the request:

$sociedade = Socio::where('user_id', '=', $consorciado->id)->get();
        return $sociedade;

The response is:

[
{
"id": 1,
"user_id": 263,
"socios": "[{\"nome\":\"ELIANA CRISTINA GUILHERMITTI RODRIGUES - 49-S\u00f3cio-Administrador\",\"cpf\":\"132.555.555-55\",\"rg\":\"12.121.212-1\",\"orgaoExp\":\"SSP\"},{\"nome\":\"SUZANA MARQUES LOBANCO - 49-S\u00f3cio-Administrador\",\"cpf\":\"132.555.555-56\",\"rg\":\"12.121.212-2\",\"orgaoExp\":\"SSP\"},{\"nome\":\"AMARILDO APARECIDO RODRIGUES - 49-S\u00f3cio-Administrador\",\"cpf\":\"132.555.555-57\",\"rg\":\"12.121.212-3\",\"orgaoExp\":\"SSP\"},{\"nome\":\"VALDEMIR FRANCISCO DA COSTA - 22-S\u00f3cio\",\"cpf\":\"132.555.555-58\",\"rg\":\"12.121.212-4\",\"orgaoExp\":\"SSP\"},{\"nome\":\"ANDRE LUIS LOBANCO - 49-S\u00f3cio-Administrador\",\"cpf\":\"132.555.555-59\",\"rg\":\"12.121.212-5\",\"orgaoExp\":\"SSP\"}]",
"created_at": "2019-10-16 14:33:02",
"updated_at": "2019-10-16 14:33:02"
}
]

So I did after the response:

if (!empty($sociedade)) {
            $socios = json_decode($sociedade->socios);
        } else {
            $socios = null;
        }

And at the view:

 @foreach($socios as $socio)
                        <li class="list-group-item">
                            <div class="row">
                                <div class="col-sm-6">
                                    <label>Nome</label>
                                    <input type="text" name="nome" class="form-control" readonly placeholder="" value="{{ $socio['nome'] }}">
                                </div>
...

The error remains the same... >:-(

Activity icon

Replied to Why It Is Not Working?

Here is the controller piece of code:

$sociedade = Socio::where('user_id', '=', $consorciado->id)->first();
        if (!empty($sociedade)) {
            $socios = json_decode($sociedade->socios);
            // return $socios;
        } else {
            $socios = null;
        }

Activity icon

Replied to Why It Is Not Working?

@afitriali : That´s my controller piece of code:

$sociedade = Socio::where('user_id', '=', $consorciado->id)->first();
        if (!empty($sociedade)) {
            $socios = json_decode($sociedade->socios);
            // return $socios;
        } else {
            $socios = null;
        }
Activity icon

Replied to Why It Is Not Working?

So I didi coded {{ dd($socio) }} inside the @foreach and the result is:

{#677 ▼
  +"nome": "ELIANA CRISTINA GUILHERMITTI RODRIGUES - 49-Sócio-Administrador"
  +"cpf": "132.555.555-55"
  +"rg": "12.121.212-1"
  +"orgaoExp": "SSP"
}

I am pretty sure it is something so easy, that I can´t see...

Activity icon

Started a new Conversation Why It Is Not Working?

I have this code as a response from:

$sociedade = Socio::where('user_id', '=', $consorciado->id)->first();
        if (!empty($sociedade)) {
            $socios = json_decode($sociedade->socios);
            return $socios;
        } else {
            $socios = null;
        }

This is what? An array? An object?

[
{
"nome": "ELIANA CRISTINA GUILHERMITTI RODRIGUES - 49-Sócio-Administrador",
"cpf": "132.555.555-55",
"rg": "12.121.212-1",
"orgaoExp": "SSP"
},
{
"nome": "SUZANA MARQUES LOBANCO - 49-Sócio-Administrador",
"cpf": "132.555.555-56",
"rg": "12.121.212-2",
"orgaoExp": "SSP"
},
{
"nome": "AMARILDO APARECIDO RODRIGUES - 49-Sócio-Administrador",
"cpf": "132.555.555-57",
"rg": "12.121.212-3",
"orgaoExp": "SSP"
},
{
"nome": "VALDEMIR FRANCISCO DA COSTA - 22-Sócio",
"cpf": "132.555.555-58",
"rg": "12.121.212-4",
"orgaoExp": "SSP"
},
{
"nome": "ANDRE LUIS LOBANCO - 49-Sócio-Administrador",
"cpf": "132.555.555-59",
"rg": "12.121.212-5",
"orgaoExp": "SSP"
}
]

At the view I have a foreach loop, like:

 @foreach($socios as $socio)
                        <li class="list-group-item">
                            <div class="row">
                                <div class="col-sm-6">
                                    <label>Nome</label>
                                    <input type="text" name="nome" class="form-control" readonly placeholder="" value="{{ $socio->nome }}">
                                </div>
... 

But that is always an error:


Array to string conversion (View: /Users/marcellopato/Sites/primorossi/resources/views/contemplado/fichaCadastralEdit.blade.php)

I did the same thing on another piece of code and it worked, but it is not working now? What I am doing wrong?

Thanks

Oct
03
2 months ago
Activity icon

Replied to How To Read This?

It is incredible how easy stuff is unreadable sometimes, huh? Thanks a lot for your help @resin !!

Oct
02
2 months ago
Activity icon

Replied to How To Read This?

Sure!

The line on DB:

id: 11  
imoveis: [{"cep":"03309-001","rua":"Rua Serra do Japi","numero":"456","complemento":"de 1001\/1002 ao fim","bairro":"Vila Gomes Cardim","cidade":"S\u00e3o Paulo","UF":"SP"},{"cep":"06006-006","rua":"Rua Serra do Jap\u00ea","numero":"999","complemento":null,"bairro":"Vila Gomes Carpe Dien","cidade":"S\u00e3o Paulo","UF":"SP"}] 
user_id: 342    
created_at: 2019-10-02 13:05:18 
updated_at: 2019-10-02 13:05:18

The controller request:

$imovel = Imovel::where('user_id', '=', $analise->user_id)->first();
        $imoveis = json_decode($imovel);

So, imoveis is field from the table

Activity icon

Replied to How To Read This?

@resin

I did:

<ul  class="list-group">
   @foreach ($imoveis as $imovel)
       <li class="list-group-item">CEP: {{ $imovel['cep'] }}</li>
   @endforeach
</ul>

But got this error:

Illegal string offset 'cep' (View: /Users/marcellopato/Sites/primorossi/resources/views/vendor/voyager/analises/browse.blade.php)
Activity icon

Started a new Conversation How To Read This?

Hello folks! I know it is a pretty basic question, but I am kind of lost with it. I have a field with this data:

[{"cep":"03309-001","rua":"Rua Serra do Japi","numero":"456","complemento":"de 1001\/1002 ao fim","bairro":"Vila Gomes Cardim","cidade":"S\u00e3o Paulo","UF":"SP"},{"cep":"06006-006","rua":"Rua Serra do Jap\u00ea","numero":"999","complemento":null,"bairro":"Vila Gomes Carpe Dien","cidade":"S\u00e3o Paulo","UF":"SP"}]

I did:

$imoveis = json_decode($imovel);
        dd($imoveis);

...and the result is:

{#384 ▼
  +"id": 11
  +"imoveis": "[{"cep":"03309-001","rua":"Rua Serra do Japi","numero":"456","complemento":"de 1001\/1002 ao fim","bairro":"Vila Gomes Cardim","cidade":"S\u00e3o Paulo","UF":"S ▶"
  +"user_id": 342
  +"created_at": "2019-10-02 13:05:18"
  +"updated_at": "2019-10-02 13:05:18"
}

I want to render on my view:

cep: 03309-001
rua: Rua Serra do Japi,
numero: 456
...

How do I do it?

Thanks in advance!

Sep
16
3 months ago
Activity icon

Replied to How To Run Through A Collection?

I guess this is what I need:

$pagas = $responseExtrato->ExtratoContaCorrente->{'PARCELAS-PAGAS'}->{'PARCELA-PAGA'};
return $pagas;

Then, when return $pagas, I get:

[
{
"NUMERO-PARCELA": 1,
"DATA-VENCIMENTO": "20120608",
"DATA-PAGAMENTO": "20120606",
"VALOR-PARCELA": 321,
"HITORICO-PARCELA": "CH - 577                 00010",
"PERC-PAGO": 2.181
},
{
"NUMERO-PARCELA": 1,
"DATA-VENCIMENTO": "20120608",
"DATA-PAGAMENTO": "20120606",
"VALOR-PARCELA": 321,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7819
},
{
"NUMERO-PARCELA": 2,
"DATA-VENCIMENTO": "20120708",
"DATA-PAGAMENTO": "20120709",
"VALOR-PARCELA": 320.56,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 3,
"DATA-VENCIMENTO": "20120808",
"DATA-PAGAMENTO": "20120808",
"VALOR-PARCELA": 320.56,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 4,
"DATA-VENCIMENTO": "20120908",
"DATA-PAGAMENTO": "20120910",
"VALOR-PARCELA": 320.56,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 5,
"DATA-VENCIMENTO": "20121008",
"DATA-PAGAMENTO": "20121008",
"VALOR-PARCELA": 320.56,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 6,
"DATA-VENCIMENTO": "20121108",
"DATA-PAGAMENTO": "20121108",
"VALOR-PARCELA": 320.56,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 7,
"DATA-VENCIMENTO": "20121208",
"DATA-PAGAMENTO": "20121210",
"VALOR-PARCELA": 320.56,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 8,
"DATA-VENCIMENTO": "20130108",
"DATA-PAGAMENTO": "20130107",
"VALOR-PARCELA": 320.56,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 9,
"DATA-VENCIMENTO": "20130208",
"DATA-PAGAMENTO": "20130208",
"VALOR-PARCELA": 320.56,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 10,
"DATA-VENCIMENTO": "20130308",
"DATA-PAGAMENTO": "20130308",
"VALOR-PARCELA": 320.56,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 11,
"DATA-VENCIMENTO": "20130408",
"DATA-PAGAMENTO": "20130408",
"VALOR-PARCELA": 320.56,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 12,
"DATA-VENCIMENTO": "20130508",
"DATA-PAGAMENTO": "20130508",
"VALOR-PARCELA": 320.56,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 13,
"DATA-VENCIMENTO": "20130608",
"DATA-PAGAMENTO": "20130610",
"VALOR-PARCELA": 346.49,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 14,
"DATA-VENCIMENTO": "20130708",
"DATA-PAGAMENTO": "20130708",
"VALOR-PARCELA": 346.49,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 15,
"DATA-VENCIMENTO": "20130808",
"DATA-PAGAMENTO": "20130808",
"VALOR-PARCELA": 346.49,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 16,
"DATA-VENCIMENTO": "20130908",
"DATA-PAGAMENTO": "20130909",
"VALOR-PARCELA": 346.49,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 17,
"DATA-VENCIMENTO": "20131008",
"DATA-PAGAMENTO": "20131007",
"VALOR-PARCELA": 346.49,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 18,
"DATA-VENCIMENTO": "20131108",
"DATA-PAGAMENTO": "20131108",
"VALOR-PARCELA": 346.49,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 19,
"DATA-VENCIMENTO": "20131208",
"DATA-PAGAMENTO": "20131209",
"VALOR-PARCELA": 346.49,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 20,
"DATA-VENCIMENTO": "20140108",
"DATA-PAGAMENTO": "20140108",
"VALOR-PARCELA": 346.49,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 21,
"DATA-VENCIMENTO": "20140208",
"DATA-PAGAMENTO": "20140210",
"VALOR-PARCELA": 346.49,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 22,
"DATA-VENCIMENTO": "20140308",
"DATA-PAGAMENTO": "20140310",
"VALOR-PARCELA": 346.49,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 23,
"DATA-VENCIMENTO": "20140408",
"DATA-PAGAMENTO": "20140408",
"VALOR-PARCELA": 346.49,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 24,
"DATA-VENCIMENTO": "20140508",
"DATA-PAGAMENTO": "20140508",
"VALOR-PARCELA": 320.56,
"HITORICO-PARCELA": "5754987                  00010",
"PERC-PAGO": 2.5535
},
{
"NUMERO-PARCELA": 25,
"DATA-VENCIMENTO": "20140608",
"DATA-PAGAMENTO": "20140609",
"VALOR-PARCELA": 397.97,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.998
},
{
"NUMERO-PARCELA": 26,
"DATA-VENCIMENTO": "20140708",
"DATA-PAGAMENTO": "20140708",
"VALOR-PARCELA": 370.72,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 27,
"DATA-VENCIMENTO": "20140808",
"DATA-PAGAMENTO": "20140808",
"VALOR-PARCELA": 370.72,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 28,
"DATA-VENCIMENTO": "20140908",
"DATA-PAGAMENTO": "20140908",
"VALOR-PARCELA": 370.72,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 29,
"DATA-VENCIMENTO": "20141008",
"DATA-PAGAMENTO": "20141106",
"VALOR-PARCELA": 380.91,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 30,
"DATA-VENCIMENTO": "20141108",
"DATA-PAGAMENTO": "20141110",
"VALOR-PARCELA": 370.72,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 31,
"DATA-VENCIMENTO": "20141208",
"DATA-PAGAMENTO": "20150106",
"VALOR-PARCELA": 380.91,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 32,
"DATA-VENCIMENTO": "20150108",
"DATA-PAGAMENTO": "20150108",
"VALOR-PARCELA": 370.72,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 33,
"DATA-VENCIMENTO": "20150208",
"DATA-PAGAMENTO": "20150306",
"VALOR-PARCELA": 380.57,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7778
},
{
"NUMERO-PARCELA": 34,
"DATA-VENCIMENTO": "20150308",
"DATA-PAGAMENTO": "20150312",
"VALOR-PARCELA": 377.93,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7768
},
{
"NUMERO-PARCELA": 35,
"DATA-VENCIMENTO": "20150408",
"DATA-PAGAMENTO": "20150408",
"VALOR-PARCELA": 370.85,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.7788
},
{
"NUMERO-PARCELA": 36,
"DATA-VENCIMENTO": "20150508",
"DATA-PAGAMENTO": "20150508",
"VALOR-PARCELA": 370.82,
"HITORICO-PARCELA": "                         00010",
"PERC-PAGO": 2.777
}
]

How can I loop through this on a view? It is an array, right?

Activity icon

Replied to How To Run Through A Collection?

Sometimes I feel like dumb. LOL! Thanks @snapey !

Activity icon

Replied to How To Run Through A Collection?

True. But now I´m getting this error:

ErrorException thrown with message "Object of class stdClass could not be converted to string (View: /Users/marcellopato/Sites/primorossi/resources/views/contemplado/extrato.blade.php)"

By the way, need to wrap the key in curly brackets:

$pagas = $responseExtrato->ExtratoContaCorrente->{'PARCELAS-PAGAS'};

At my Controller:

return view('contemplado.extrato')->withPagas($pagas);

Then send the var to VueJS script to v-for like this:

<script>
    var app = new Vue({
        el: '#app',
        data: {
            isLoading: false,
            enderecos: '',
            parcelas_pagas: '{!! $pagas !!}'
        },
        methods: {
            //
        },
        mounted() {
            this.isLoading = false
        }
    });
</script>
Activity icon

Started a new Conversation How To Run Through A Collection?

I have this:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <ROS_ExtratoContaCorrenteResponse xmlns="http://tempuri.org/">
         <ExtratoContaCorrente xsi:type="ExtratoContaCorrenteSiacon">
            <NOME-CLIENTE>IRENE CONSTANCIA NOVAIS 86725351620</NOME-CLIENTE>
            <CODIGO-GRUPO>06248</CODIGO-GRUPO>
            <NUMERO-COTA>448</NUMERO-COTA>
            <NOME-LOGRADOURO>SOLIDARIEDADE</NOME-LOGRADOURO>
            <NUMERO-LOGRADOURO>320</NUMERO-LOGRADOURO>
            <BAIRRO>DOM ALMIR</BAIRRO>
            <CIDADE>UBERLANDIA</CIDADE>
            <UF>MG</UF>
            <CEP>38407030</CEP>
            <NUMERO-TELEFONE>034 991451593</NUMERO-TELEFONE>
            <CODIGO-BEM>6161</CODIGO-BEM>
            <VALOR-BEM>39043</VALOR-BEM>
            <PERC-TOTAL-PAGO>32.7673</PERC-TOTAL-PAGO>
            <VALOR-QUITACAO>30341.23</VALOR-QUITACAO>
            <PERC-TOAL-PAGAR>1.6411</PERC-TOAL-PAGAR>
            <PARCELAS-PAGAS xsi:type="ParcelasPagasSiacon">
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>139</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20171218</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20171218</DATA-PAGAMENTO>
                  <VALOR-PARCELA>691.57</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.2178</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>140</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20180118</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20180117</DATA-PAGAMENTO>
                  <VALOR-PARCELA>692.71</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.2178</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>141</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20180218</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20180216</DATA-PAGAMENTO>
                  <VALOR-PARCELA>692.71</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.2178</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>142</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20180318</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20180316</DATA-PAGAMENTO>
                  <VALOR-PARCELA>692.71</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.2178</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>143</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20180418</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20180417</DATA-PAGAMENTO>
                  <VALOR-PARCELA>692.71</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.2178</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>144</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20180518</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20180518</DATA-PAGAMENTO>
                  <VALOR-PARCELA>692.71</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.2178</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>145</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20180618</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20180618</DATA-PAGAMENTO>
                  <VALOR-PARCELA>692.71</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.2178</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>146</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20180718</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20180716</DATA-PAGAMENTO>
                  <VALOR-PARCELA>692.67</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.613</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>147</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20180818</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20180817</DATA-PAGAMENTO>
                  <VALOR-PARCELA>716.8</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.6411</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>148</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20180918</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20180917</DATA-PAGAMENTO>
                  <VALOR-PARCELA>704.74</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.6411</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>149</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20181018</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20181018</DATA-PAGAMENTO>
                  <VALOR-PARCELA>704.74</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.6145</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>150</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20181118</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20181119</DATA-PAGAMENTO>
                  <VALOR-PARCELA>727.95</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.6411</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>151</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20181218</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20181217</DATA-PAGAMENTO>
                  <VALOR-PARCELA>716.35</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.6092</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>152</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20190118</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20190111</DATA-PAGAMENTO>
                  <VALOR-PARCELA>744.77</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.6411</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>153</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20190218</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20190218</DATA-PAGAMENTO>
                  <VALOR-PARCELA>712.06</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.6411</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>154</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20190318</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20190312</DATA-PAGAMENTO>
                  <VALOR-PARCELA>712.06</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.6411</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>155</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20190418</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20190410</DATA-PAGAMENTO>
                  <VALOR-PARCELA>730.58</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.6411</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>156</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20190518</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20190506</DATA-PAGAMENTO>
                  <VALOR-PARCELA>730.58</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.6411</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>157</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20190618</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20190604</DATA-PAGAMENTO>
                  <VALOR-PARCELA>730.58</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.619</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>158</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20190718</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20190704</DATA-PAGAMENTO>
                  <VALOR-PARCELA>750.53</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.6411</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>159</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20190818</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20190819</DATA-PAGAMENTO>
                  <VALOR-PARCELA>740.56</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.6411</PERC-PAGO>
               </PARCELA-PAGA>
            </PARCELAS-PAGAS>
            <PARCELAS-PENDENTES xsi:type="ParcelasPendentesSiacon">
               <PARCELAS-PENDENTES>
                  <NUMERO-PARCELA>23</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20190918</DATA-VENCIMENTO>
                  <VALOR-PARCELA>740.56</VALOR-PARCELA>
                  <PERC-PENDENTE>1.6411</PERC-PENDENTE>
               </PARCELAS-PENDENTES>
               <VALOR-TOTAL-PENDENTE>740.56</VALOR-TOTAL-PENDENTE>
               <PERC-TOTAL-PENDENTE>1.6411</PERC-TOTAL-PENDENTE>
            </PARCELAS-PENDENTES>
            <PROXIMA-ASSEMBLEIA xsi:type="ProximaAssembleiaSiacon">
               <DATA-ASSEMB>20190924</DATA-ASSEMB>
               <DATA-SORTEIO>20190921</DATA-SORTEIO>
               <HORARIO-ASSEMB>1600</HORARIO-ASSEMB>
               <ENDERESO-ASSEMB>GOVERNADOR RONDON PACHECO</ENDERESO-ASSEMB>
               <BAIRRO-ASSEMB>VILA POVOA</BAIRRO-ASSEMB>
               <CIDADE-ASSEMB>UBERLANDIA</CIDADE-ASSEMB>
               <UF-ASSEMB>MG</UF-ASSEMB>
            </PROXIMA-ASSEMBLEIA>
            <RESULT-ULTIMA-ASSEMB xsi:type="ResultadoUltimaAssembleiaSiacon">
               <DATA-REALIZACAO>20190823</DATA-REALIZACAO>
               <COTAS-CONTEMP-SORTEIO>
                  <NUMERO-COTA>759</NUMERO-COTA>
               </COTAS-CONTEMP-SORTEIO>
               <COTAS-CONTEMP-LANCE>
                  <NUMERO-COTA>426</NUMERO-COTA>
                  <PERC-LANCE>1.7029</PERC-LANCE>
                  <QDE-PARCELAS>0.837</QDE-PARCELAS>
               </COTAS-CONTEMP-LANCE>
               <COTAS-CONTEMP-LANCE>
                  <NUMERO-COTA>725</NUMERO-COTA>
                  <PERC-LANCE>7.4529</PERC-LANCE>
                  <QDE-PARCELAS>4.949</QDE-PARCELAS>
               </COTAS-CONTEMP-LANCE>
            </RESULT-ULTIMA-ASSEMB>
            <CODIGO-RETORNO>0</CODIGO-RETORNO>
            <DESCRICAO-RETORNO/>
         </ExtratoContaCorrente>
      </ROS_ExtratoContaCorrenteResponse>
   </soap:Body>
</soap:Envelope>

As response from a WS request.

{
"NOME-CLIENTE": "ANGELICA RODRIGUES DE OLIVEIRA" *-> PARCELAS-PAGAS*
"CODIGO-GRUPO": "06271",
"NUMERO-COTA": 161,
"NOME-LOGRADOURO": "DOZE",
"NUMERO-LOGRADOURO": "130",
"BAIRRO": "BELA SUICA I",
"CIDADE": "ARAGUARI",
"UF": "MG",
"CEP": "38441469",
"NUMERO-TELEFONE": "034 992196653",
"CODIGO-BEM": "6220",
"VALOR-BEM": 22300,
"PERC-TOTAL-PAGO": 3.325,
"VALOR-QUITACAO": 25679.46,
"PERC-TOAL-PAGAR": 25.8602,
"PARCELAS-PAGAS": {},
"PARCELAS-PENDENTES": {
"VALOR-TOTAL-PENDENTE": 0,
"PERC-TOTAL-PENDENTE": 0
},
"PROXIMA-ASSEMBLEIA": {
"DATA-ASSEMB": "20191011",
"DATA-SORTEIO": "20191009",
"HORARIO-ASSEMB": "1600",
"ENDERESO-ASSEMB": "GOVERNADOR RONDON PACHECO  ",
"BAIRRO-ASSEMB": "VILA POVOA",
"CIDADE-ASSEMB": "UBERLANDIA",
"UF-ASSEMB": "MG"
},
"RESULT-ULTIMA-ASSEMB": {
"DATA-REALIZACAO": "20190913",
"COTAS-CONTEMP-SORTEIO": [
{
"NUMERO-COTA": 75
},
{
"NUMERO-COTA": 177
}
],
"COTAS-CONTEMP-LANCE": [
{
"NUMERO-COTA": 161,
"PERC-LANCE": 30,
"QDE-PARCELAS": 7.8
},
{
"NUMERO-COTA": 193,
"PERC-LANCE": 30,
"QDE-PARCELAS": 13.5
},
{
"NUMERO-COTA": 347,
"PERC-LANCE": 31.25,
"QDE-PARCELAS": 20.312
},
{
"NUMERO-COTA": 400,
"PERC-LANCE": 31.25,
"QDE-PARCELAS": 8.438
},
{
"NUMERO-COTA": 403,
"PERC-LANCE": 25.1121,
"QDE-PARCELAS": 6.529
},
{
"NUMERO-COTA": 404,
"PERC-LANCE": 31.1676,
"QDE-PARCELAS": 8.104
},
{
"NUMERO-COTA": 405,
"PERC-LANCE": 24.187,
"QDE-PARCELAS": 16.002
},
{
"NUMERO-COTA": 411,
"PERC-LANCE": 21.7209,
"QDE-PARCELAS": 5.647
},
{
"NUMERO-COTA": 775,
"PERC-LANCE": 15,
"QDE-PARCELAS": 18.103
}
]
},
"CODIGO-RETORNO": 0,
"DESCRICAO-RETORNO": ""
}

My controller is like:

$url = env('URL_WS');
        $id = Auth::user()->id;
        $consorciado = User::where('id', '=', $id)->first();
        $grupoEcota = new \SoapClient($url);
        $paramExtrato = array(
            'sGrupo' => $grupo,
            'iCota' => $cota,
            'iIdERP' => $consorciado->idERP,
        );
        $responseExtrato = $grupoEcota->ROS_ExtratoContaCorrente($paramExtrato);
        $grupoEcota = $responseExtrato->ExtratoContaCorrente;
        $collection = collect($grupoEcota);
        $collection->all();
        return $collection;
        return view('contemplado.extrato')->withCollection($collection);

How can I access a node and loop through like this one:

PARCELAS-PAGAS

<PARCELA-PAGA>
                  <NUMERO-PARCELA>139</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20171218</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20171218</DATA-PAGAMENTO>
                  <VALOR-PARCELA>691.57</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.2178</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>140</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20180118</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20180117</DATA-PAGAMENTO>
                  <VALOR-PARCELA>692.71</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.2178</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>141</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20180218</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20180216</DATA-PAGAMENTO>
                  <VALOR-PARCELA>692.71</VALOR-PARCELA>
                  <HITORICO-PARCELA/>
                  <PERC-PAGO>1.2178</PERC-PAGO>
               </PARCELA-PAGA>
....
Sep
10
3 months ago
Activity icon

Started a new Conversation Read An XML Correctly?

Hello guys! I am consuming a WS and the response is:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <ROS_ExtratoContaCorrenteResponse xmlns="http://tempuri.org/">
         <ExtratoContaCorrente xsi:type="ExtratoContaCorrenteSiacon">
            <NOME-CLIENTE>LIGIA SOUZA DA SILVA</NOME-CLIENTE>
            <CODIGO-GRUPO>07346</CODIGO-GRUPO>
            <NUMERO-COTA>166</NUMERO-COTA>
            <NOME-LOGRADOURO>CLARA CAMARAO</NOME-LOGRADOURO>
            <NUMERO-LOGRADOURO>74</NUMERO-LOGRADOURO>
            <BAIRRO>NOSSA SENHORA DAS GRACAS</BAIRRO>
            <CIDADE>UBERLANDIA</CIDADE>
            <UF>MG</UF>
            <CEP>38402010</CEP>
            <NUMERO-TELEFONE>034 32531781</NUMERO-TELEFONE>
            <CODIGO-BEM>534</CODIGO-BEM>
            <VALOR-BEM>6376.18</VALOR-BEM>
            <PERC-TOTAL-PAGO>99.9999</PERC-TOTAL-PAGO>
            <VALOR-QUITACAO>0.01</VALOR-QUITACAO>
            <PERC-TOAL-PAGAR>0</PERC-TOAL-PAGAR>
            <PARCELAS-PAGAS xsi:type="ParcelasPagasSiacon">
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>31</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20090119</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20090807</DATA-PAGAMENTO>
                  <VALOR-PARCELA>77.26</VALOR-PARCELA>
                  <HITORICO-PARCELA>Amort TAd154.52          00270</HITORICO-PARCELA>
                  <PERC-PAGO>1.3025</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>32</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20090216</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20090807</DATA-PAGAMENTO>
                  <VALOR-PARCELA>77.26</VALOR-PARCELA>
                  <HITORICO-PARCELA>Amort TAdi154.52         00270</HITORICO-PARCELA>
                  <PERC-PAGO>1.3049</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>33</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20090316</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20090310</DATA-PAGAMENTO>
                  <VALOR-PARCELA>99</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>0.2508</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>34</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20090420</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20090312</DATA-PAGAMENTO>
                  <VALOR-PARCELA>98.71</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>0.25</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>35</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20090518</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20090507</DATA-PAGAMENTO>
                  <VALOR-PARCELA>98.71</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>0.25</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>36</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20090618</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20090605</DATA-PAGAMENTO>
                  <VALOR-PARCELA>98.71</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>0.25</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>37</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20090718</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20090706</DATA-PAGAMENTO>
                  <VALOR-PARCELA>85.25</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.3025</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>38</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20090818</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20090807</DATA-PAGAMENTO>
                  <VALOR-PARCELA>95.42</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.4739</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>39</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20090918</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20090824</DATA-PAGAMENTO>
                  <VALOR-PARCELA>95.42</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.4739</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>40</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20091018</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20091006</DATA-PAGAMENTO>
                  <VALOR-PARCELA>95.42</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.4739</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>41</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20091118</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20091106</DATA-PAGAMENTO>
                  <VALOR-PARCELA>95.42</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.4739</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>42</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20091218</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20091207</DATA-PAGAMENTO>
                  <VALOR-PARCELA>95.42</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.4739</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>43</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20100118</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20100106</DATA-PAGAMENTO>
                  <VALOR-PARCELA>95.42</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.4739</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>44</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20100218</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20100205</DATA-PAGAMENTO>
                  <VALOR-PARCELA>95.42</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.4739</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>45</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20100318</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20100305</DATA-PAGAMENTO>
                  <VALOR-PARCELA>95.42</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.4739</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>46</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20100418</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20100423</DATA-PAGAMENTO>
                  <VALOR-PARCELA>97.32</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.4739</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>47</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20100518</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20100604</DATA-PAGAMENTO>
                  <VALOR-PARCELA>97.67</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.4739</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>48</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20100618</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20100706</DATA-PAGAMENTO>
                  <VALOR-PARCELA>97.69</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.4739</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>49</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20100718</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20100706</DATA-PAGAMENTO>
                  <VALOR-PARCELA>95.42</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.4739</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>50</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20100818</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20100903</DATA-PAGAMENTO>
                  <VALOR-PARCELA>97.64</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.3659</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>51</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20100918</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20101005</DATA-PAGAMENTO>
                  <VALOR-PARCELA>105.39</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.474</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>52</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20101018</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20101105</DATA-PAGAMENTO>
                  <VALOR-PARCELA>105.43</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.474</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>53</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20101118</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20101217</DATA-PAGAMENTO>
                  <VALOR-PARCELA>105.77</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.474</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>54</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20101218</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20110119</DATA-PAGAMENTO>
                  <VALOR-PARCELA>105.87</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.474</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>55</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20110118</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20110124</DATA-PAGAMENTO>
                  <VALOR-PARCELA>112.05</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.5812</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>56</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20110218</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20110124</DATA-PAGAMENTO>
                  <VALOR-PARCELA>102.97</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.474</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>57</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20110318</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20110412</DATA-PAGAMENTO>
                  <VALOR-PARCELA>105.65</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.474</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>58</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20110418</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20110512</DATA-PAGAMENTO>
                  <VALOR-PARCELA>105.61</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.474</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>59</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20110518</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20110606</DATA-PAGAMENTO>
                  <VALOR-PARCELA>105.58</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.4759</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>60</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20110618</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20110713</DATA-PAGAMENTO>
                  <VALOR-PARCELA>105.65</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.474</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>61</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20110718</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20110808</DATA-PAGAMENTO>
                  <VALOR-PARCELA>105.52</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.474</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>62</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20110818</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20110905</DATA-PAGAMENTO>
                  <VALOR-PARCELA>105.43</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.474</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>63</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20110918</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20111005</DATA-PAGAMENTO>
                  <VALOR-PARCELA>105.39</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.474</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>64</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20111018</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20111104</DATA-PAGAMENTO>
                  <VALOR-PARCELA>105.39</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.474</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>65</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20111118</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20111104</DATA-PAGAMENTO>
                  <VALOR-PARCELA>102.97</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.474</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>66</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20111218</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20111205</DATA-PAGAMENTO>
                  <VALOR-PARCELA>102.97</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.474</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>67</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20120118</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20120106</DATA-PAGAMENTO>
                  <VALOR-PARCELA>102.97</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.474</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>68</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20120218</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20120113</DATA-PAGAMENTO>
                  <VALOR-PARCELA>102.97</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.474</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>69</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20120318</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20120405</DATA-PAGAMENTO>
                  <VALOR-PARCELA>105.43</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.474</PERC-PAGO>
               </PARCELA-PAGA>
               <PARCELA-PAGA>
                  <NUMERO-PARCELA>70</NUMERO-PARCELA>
                  <DATA-VENCIMENTO>20120418</DATA-VENCIMENTO>
                  <DATA-PAGAMENTO>20120405</DATA-PAGAMENTO>
                  <VALOR-PARCELA>102.97</VALOR-PARCELA>
                  <HITORICO-PARCELA>00010</HITORICO-PARCELA>
                  <PERC-PAGO>1.474</PERC-PAGO>
               </PARCELA-PAGA>
            </PARCELAS-PAGAS>
            <PARCELAS-PENDENTES xsi:type="ParcelasPendentesSiacon">
               <VALOR-TOTAL-PENDENTE>0</VALOR-TOTAL-PENDENTE>
               <PERC-TOTAL-PENDENTE>0</PERC-TOTAL-PENDENTE>
            </PARCELAS-PENDENTES>
            <PROXIMA-ASSEMBLEIA xsi:type="ProximaAssembleiaSiacon">
               <DATA-ASSEMB/>
               <DATA-SORTEIO/>
               <HORARIO-ASSEMB/>
               <ENDERESO-ASSEMB/>
               <BAIRRO-ASSEMB/>
               <CIDADE-ASSEMB/>
               <UF-ASSEMB/>
            </PROXIMA-ASSEMBLEIA>
            <RESULT-ULTIMA-ASSEMB xsi:type="ResultadoUltimaAssembleiaSiacon">
               <DATA-REALIZACAO>20130221</DATA-REALIZACAO>
               <COTAS-CONTEMP-SORTEIO>
                  <NUMERO-COTA>31</NUMERO-COTA>
               </COTAS-CONTEMP-SORTEIO>
               <COTAS-CONTEMP-SORTEIO>
                  <NUMERO-COTA>147</NUMERO-COTA>
               </COTAS-CONTEMP-SORTEIO>
               <COTAS-CONTEMP-SORTEIO>
                  <NUMERO-COTA>155</NUMERO-COTA>
               </COTAS-CONTEMP-SORTEIO>
               <COTAS-CONTEMP-SORTEIO>
                  <NUMERO-COTA>158</NUMERO-COTA>
               </COTAS-CONTEMP-SORTEIO>
               <COTAS-CONTEMP-SORTEIO>
                  <NUMERO-COTA>190</NUMERO-COTA>
               </COTAS-CONTEMP-SORTEIO>
               <COTAS-CONTEMP-SORTEIO>
                  <NUMERO-COTA>193</NUMERO-COTA>
               </COTAS-CONTEMP-SORTEIO>
               <COTAS-CONTEMP-SORTEIO>
                  <NUMERO-COTA>281</NUMERO-COTA>
               </COTAS-CONTEMP-SORTEIO>
               <COTAS-CONTEMP-SORTEIO>
                  <NUMERO-COTA>307</NUMERO-COTA>
               </COTAS-CONTEMP-SORTEIO>
               <COTAS-CONTEMP-SORTEIO>
                  <NUMERO-COTA>362</NUMERO-COTA>
               </COTAS-CONTEMP-SORTEIO>
               <COTAS-CONTEMP-SORTEIO>
                  <NUMERO-COTA>391</NUMERO-COTA>
               </COTAS-CONTEMP-SORTEIO>
               <COTAS-CONTEMP-SORTEIO>
                  <NUMERO-COTA>425</NUMERO-COTA>
               </COTAS-CONTEMP-SORTEIO>
               <COTAS-CONTEMP-SORTEIO>
                  <NUMERO-COTA>462</NUMERO-COTA>
               </COTAS-CONTEMP-SORTEIO>
               <COTAS-CONTEMP-SORTEIO>
                  <NUMERO-COTA>464</NUMERO-COTA>
               </COTAS-CONTEMP-SORTEIO>
            </RESULT-ULTIMA-ASSEMB>
            <CODIGO-RETORNO>0</CODIGO-RETORNO>
            <DESCRICAO-RETORNO/>
         </ExtratoContaCorrente>
      </ROS_ExtratoContaCorrenteResponse>
   </soap:Body>
</soap:Envelope>

Which is the best way to read this file in a way that I can loop through each node and show it on a blade view?

Aug
27
3 months ago
Activity icon

Replied to Dealing With A [( )] Response

Ops, clicked the Best Answer button! It is not a vue component, it is in a view blade file

Activity icon

Started a new Conversation Dealing With A [( )] Response

Hello guys! I have this:

[{"id":1,"user_id":480,"contrato":"859866","grupo":"07384","cota":"853","valor":"12975","novoSegmento":null,"originalSegmento":"07384","completo":null,"novoUsado":null,"pessoa":"J","descricao":"HONDA NXR 160 BROS","data_entrega":"2018-05-07 00:00:00","data_contemplacao":"2017-06-22 00:00:00","cep":"15115000","codFormaPagto":"1","codigo_bem":"3863","codPlanoCota":"31","data_cancelamento":"1970-01-01 00:00:01","dataProxReuniao":"2019-06-24 00:00:00","descSituacaoCobranca":"Quitação","faseCobranca":"Q000","numSeq":"0","percQuitacao":"0","percTotalPago":"100","percTotalPendente":"0","situacaoCobranca":"Q","created_at":"2019-08-27 13:24:25","updated_at":"2019-08-27 13:24:43"},{"id":2,"user_id":480,"contrato":"861990","grupo":"07384","cota":"835","valor":"11945","novoSegmento":null,"originalSegmento":"07384","completo":null,"novoUsado":null,"pessoa":"J","descricao":"HONDA CG 160 FAN ESDI","data_entrega":"2018-05-07 00:00:00","data_contemplacao":"2017-06-22 00:00:00","cep":"15115000","codFormaPagto":"1","codigo_bem":"3870","codPlanoCota":"31","data_cancelamento":"1970-01-01 00:00:01","dataProxReuniao":"2019-06-24 00:00:00","descSituacaoCobranca":"Quitação","faseCobranca":"Q000","numSeq":"0","percQuitacao":"0","percTotalPago":"100","percTotalPendente":"0","situacaoCobranca":"Q","created_at":"2019-08-27 13:24:25","updated_at":"2019-08-27 13:24:47"},{"id":3,"user_id":480,"contrato":"865778","grupo":"07384","cota":"209","valor":"12110","novoSegmento":null,"originalSegmento":"07384","completo":null,"novoUsado":null,"pessoa":"J","descricao":"HONDA BIZ 125","data_entrega":"2018-05-07 00:00:00","data_contemplacao":"2017-10-23 00:00:00","cep":"15115000","codFormaPagto":"1","codigo_bem":"3871","codPlanoCota":"24","data_cancelamento":"1970-01-01 00:00:01","dataProxReuniao":"2019-06-24 00:00:00","descSituacaoCobranca":"Quitação","faseCobranca":"Q000","numSeq":"0","percQuitacao":"0","percTotalPago":"100","percTotalPendente":"0","situacaoCobranca":"Q","created_at":"2019-08-27 13:24:25","updated_at":"2019-08-27 13:24:50"},{"id":4,"user_id":480,"contrato":"865779","grupo":"07384","cota":"501","valor":"12110","novoSegmento":null,"originalSegmento":"07384","completo":null,"novoUsado":null,"pessoa":"J","descricao":"HONDA BIZ 125","data_entrega":"2018-05-07 00:00:00","data_contemplacao":"2017-07-20 00:00:00","cep":"15115000","codFormaPagto":"1","codigo_bem":"3871","codPlanoCota":"24","data_cancelamento":"1970-01-01 00:00:01","dataProxReuniao":"2019-06-24 00:00:00","descSituacaoCobranca":"Quitação","faseCobranca":"Q000","numSeq":"0","percQuitacao":"0","percTotalPago":"100","percTotalPendente":"0","situacaoCobranca":"Q","created_at":"2019-08-27 13:24:25","updated_at":"2019-08-27 13:24:54"}]"

as result of a request and I am trying to do a v-for with it. But the result is a giant loop of:

<span v-for="bem in bems" class="badge badge-pill badge-warning">Descrição do Bem: @{{ bem.descricao }} - Marca: @{{ bem.marca }}, Linha: @{{ bem.linha }}</span>

with nothing on it.

What am I missing?

Aug
26
3 months ago
Activity icon

Replied to How To Get Items Inside A Collection?

I forgot to say that all this code was inside of a Model. I cut it out and pasted in a Controller and change some logic and now it is working like a breeze. But your answer has indeed clarified me a lot! Thanks!

Activity icon

Started a new Conversation How To Get Items Inside A Collection?

I am querying a table as usual, but the response is a collection?

$cadaContrato = Contrato::where('user_id', '=', $novoConsorciado->id)->get();
        dd($cadaContrato);

It returns a Collection with four items where each one is an array. It looks like:

Collection {#673 ▼
  #items: array:4 [▼
    0 => Contrato {#672 ▼
      #guarded: []
      #connection: "mysql"
      #table: "contratos"
      #primaryKey: "id"
      #keyType: "int"
      +incrementing: true
      #with: []
      #withCount: []
      #perPage: 15
      +exists: true
      +wasRecentlyCreated: false
      #attributes: array:29 [▼
        "id" => 1
        "user_id" => 467
        "contrato" => "859866"
        "grupo" => "07384"
        "cota" => "853"
        "valor" => "12975"
        "novoSegmento" => null
        "originalSegmento" => "07384"
        "completo" => null
        "novoUsado" => null
        "pessoa" => "J"
        "descricao" => "HONDA NXR 160 BROS"
        "data_entrega" => "2018-05-07 00:00:00"
        "data_contemplacao" => "2017-06-22 00:00:00"
        "cep" => "15115000"
        "codFormaPagto" => "1"
        "codigo_bem" => null
        "codPlanoCota" => "31"
        "data_cancelamento" => "1970-01-01 00:00:01"
        "dataProxReuniao" => "2019-06-24 00:00:00"
        "descSituacaoCobranca" => "Quitação"
        "faseCobranca" => "Q000"
        "numSeq" => "0"
        "percQuitacao" => "0"
        "percTotalPago" => "100"
        "percTotalPendente" => "0"
        "situacaoCobranca" => "Q"
        "created_at" => "2019-08-26 20:49:14"
        "updated_at" => "2019-08-26 20:49:14"
      ]

I want to get 'grupo' and 'cota' of each array and do a request to a WS, like:

 foreach ($cadaContrato as $contrato) {
            $grupoEcota = new \SoapClient($url);
            $paramExtrato = array(
                'sGrupo' => $contrato->grupo,
                'iCota' => $contrato->cota,
                'iIdERP' => $novoConsorciado->idERP,
            );
            $responseExtrato = $grupoEcota->ROS_ExtratoContaCorrente($paramExtrato);
            $grupoEcota = $responseExtrato->ExtratoContaCorrente;
            $contrato->codigo_bem = $contrato->{'CODIGO-BEM'};

I want to receive from each a different response. Any hints?