work on eloquent models and toArray.