1. Go to this page and download the library: Download hideto-d-kurt/arr-to-arr library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Jenssegers\Mongodb\Eloquent\Model as Eloquent;
use ArrToArr\ArrayToArray;
class Users extends Eloquent
{
protected $collection = 'users';
public static function getModel() {
return new Users();
}
public static function getAllUser()
{
$arrToarr = new ArrayToArray();
$result = self::get();
$result = json_decode($result, true);
$result = $arrToarr->removeMongoId($result);
return $result;
}
}