Top "Laravel-collection" questions

A fluent, convenient wrapper for working with arrays of data provided by Illuminate\Support\Collection class.

Eloquent Collection: Counting and Detect Empty

This may be a trivial question but I am wondering if Laravel recommends a certain way to check whether an …

laravel laravel-4 eloquent laravel-collection
How to Merge Two Eloquent Collections?

I have a questions table and a tags table. I want to fetch all questions from tags of a given …

php laravel eloquent laravel-collection
Laravel pluck fields from relations

I have a Seller object which has a related User. I need to fill a select from LaravelCollective so I …

php laravel laravelcollective laravel-collection
How to convert Laravel collection array to json

How can i convert this Laravel collection array to json format like below. //All records from users table. $users = DB::…

json laravel-5 laravel-collection
Laravel 5.2 pluck() multiple attributes from Eloquent Model Collection

Laravel 5.2 has pretty nice Helpers, I would like to use them to do following: I have Eloquent Model Collection: $lesson-&…

laravel-5.2 helpers laravel-collection
How to access the nth object in a Laravel collection object?

I have a laravel collection object. I want to use the nth model within it. How do I access it? …

php laravel laravel-collection
How to access the nth item in a Laravel collection?

I guess I am breaking all the rules by deliberately making a duplicate question... The other question has an accepted …

laravel laravel-collection
Laravel Collection Date comparison

Alright so I have been looking for hours for an answer but can't seem to find one. I have an …

php laravel laravel-5 php-carbon laravel-collection
Adding new property to Eloquent Collection

Trying to add new property to existing collection and access that. What I need is something like: $text = Text::find(1); //…

laravel laravel-5 eloquent laravel-5.2 laravel-collection
How to check if something is countable?

I have a var: $a. I don't know what it is. I want to check if I can count it. …

php arrays laravel laravel-collection