dimanche 22 décembre 2019

How to access attributes in laravel collection

I have this collection

Collection {#611
  #items: array:1 [
    0 => Payeur {#605
      #guarded: array:1 [
        0 => "id"
      ]
      #attributes: array:11 [
        "id" => 1
        "prenom_payeur" => "aymen"
        "nom_payeur" => "larabi"
        "mobile_payeur" => "non"
        "telephone" => 230493212
        "observation" => "jeflolena"
        "adresse" => "jdjfnrll"
        "event_id" => 1
        "adherent_id" => 3
        "created_at" => "2019-12-22 14:57:43"
        "updated_at" => "2019-12-22 14:57:43"
      ]
    }
  ]
}

and I want to get the nom_payeur attributes from this collection. I did this many times before and I don't know why I get this error:

(Property [nom_payeur] does not exist on this collection instance.)

I'm trying to get the attributes by doing this: $payeur->nom_payeur , $payeur is the collection. Please help.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire