jeudi 3 janvier 2019

How retrieve element from collection by name?

First, I create collection from array:

 $bank_center = collect(array("amount" => null, "mfo" => null, "name" => null));

Then I try to get value by key:

dd($bank_center->name);

Dump is:

Collection {#562 ▼
  #items: array:3 [▼
    "amount" => null
    "mfo" => null
    "name" => null
  ]
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire