I am trying to get a value from an object that I am getting from one of my models. It returns only those attributes that I do not need, because they do not match what is in my table. I want to access the source array.
I did:
$entries = Model::where('A', $A)->where('B', $B)->get(); @Foreach ($entries as $entry) $entry->id $entry->name @Endforeach
I tried adding ->original , but it either doesn't work.
Here is partly the first entry of my var_dump($entries)
( [items:protected] => Array ( [0] => App\Models\TableA Object ( [table:protected] => Table A [primaryKey] => id [connection:protected] => [perPage:protected] => 15 [incrementing] => 1 [timestamps] => 1 [attributes:protected] => Array ( [id] => 1 [name] => 2 ) [original:protected] => Array ( [id] => 1 [name] => 1 )
source share