SA__ SA__ - 1 year ago 83
JSON Question

php How to get it pure array from Eloquent Laravel

Here is my Query

$reminderData = Reminder::where('status', 1)->get()->toArray();

Here is my Result


But i need like


How can i do this ?

Answer Source

It actually returns array of arrays. You you'll use dd() on both levels, you'll see an array data type.

Also, you can get only columns you need with ->get(['id', 'reminder_type', 'reminder_date'])

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download