我试图从我从我的一个模型中获得的对象中获取一个值。它只返回我不想要的属性,因为它与我的表中的内容不对应。 我想访问原始数组。
我做了:
$entries = Model::where('A', $A)->where('B', $B)->get();
@Foreach ($entries as $entry) 
$entry->id
$entry->name
@Endforeach
我试图添加->original,但它要么不起作用。
这是我的部分第一个条目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
                        )