strana
strana copied to clipboard
Update for Eloquent version 5.3 and above
The latest Laravel database query builder (version 5.3 and above) returns a Collection instance as result instead of array, which creates problem with the existing strana package. To solve this, I've done the following -
- Created a check on the slice method of EloquentAdapter class, to see if the result set is an instance of Collection class. If it is so, the toArray method of the instance is called to return array. Otherwise, an array is returned as usual
- Updated EloquentTest; if the expected object is an instance of Collection, it is converted to array using toArray method
- Updated minimum php requirement to 5.6, as Eloquent version 5.3 and above requires php 5.6 and above, and the tests cannot be conducted without minimum php 5.6
- Recommending to create a tag
v2.0, which will be recommended for users using Eloquent version 5.3 - Updated the README to instruct users to install proposed version 2.x of this package if they are using Eloquent version 5.3
This is great for programmers using eloquent 5.3 like me.