good day ;
I have custom data base helper in laravel framework
I have easy question how to return data in array not in objects.
her is my function
public static function allData($dbName,$tableName,$condition,$data){
$stattment=
DB::connection($dbName)
->table($tableName)
->select(['*'])
->whereRaw($condition, $data)
->get();
return $stattment;
}
next function
public static function getDataById($dbName,$tableName,$condition,$data)
{
$stattment=
DB::connection($dbName)
->table($tableName)
->select(['*'])
->whereRaw($condition, $data)
->get();
return $stattment;
}
return $stattment->toArray();