以下のようなモデル$memberがあり、'attributes'のvalueだけ取り出したいのですが、nullになってしまいます。どう書けば良いのでしょうか。
var_dump($member) => object(App\Models\Accounts)[117] protected 'connection' => string 'db' (length=2) protected 'table' => null protected 'primaryKey' => string 'id' (length=2) protected 'keyType' => string 'int' (length=3) public 'incrementing' => boolean true protected 'with' => array (size=0) empty protected 'withCount' => array (size=0) empty protected 'perPage' => int 15 public 'exists' => boolean true public 'wasRecentlyCreated' => boolean false protected 'attributes' => array (size=4) 'id' => int 2 'contract_id' => int 1 'group_id' => int 3 'account_id' => int 1 protected 'original' => array (size=4) 'id' => int 2 'contract_id' => int 1 'group_id' => int 3 'account_id' => int 1 protected 'changes' => array (size=0) empty protected 'casts' => array (size=0) empty protected 'dates' => array (size=0) empty
var_dump($member['attributes']); => null var_dump($i->attributes); => null
回答2件
あなたの回答
tips
プレビュー