If you require to convert object data from db into array then you can do it using DB facade and Model Eloquent. Sometimes we need to give array data only so we must get array data from db. I have two examples so it can helps you.
In first example, If you use Model Eloquent for get data from database then you can do it using toArray(). toArray() will help to convert object into array data. So let's see bellow example and check it.
<pre class="prettyprint lang-php">
$users = User::get()->toArray();
In this example, if you use DB facade for ge.....