strana icon indicating copy to clipboard operation
strana copied to clipboard

Update for Eloquent version 5.3 and above

Open faheem00 opened this issue 8 years ago • 1 comments

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

faheem00 avatar Jul 27 '17 07:07 faheem00

This is great for programmers using eloquent 5.3 like me.

carlosh1989 avatar Jul 27 '17 16:07 carlosh1989