Category "laravel-collection"

Laravel Collections. Is there some kind of assertStructure method?

I'm writing tests and I want to assert, that a returned collection has some specific structure. For asserting jsons I'm using assertJsonStructure() method on

How can i paginate laravel collection?

here is how i trying to paginate: $posts = Post::all()->sortByDesc("created_at")->pagination(1); but i get this error: Method Illuminate\Database\Eloquen

Natural ORDER in Laravel Eloquent ORM

How can i get 'natural order' in 'Eloquent ORM'? In table I have column 'text' (string). Normal order: Model::orderBy('text') 'value 1' 'value 12' 'value 23'