lundi 2 mai 2016

Why is pluck('id') returning all id-s instead of just one?

The following query returns every Quote's id-s, instead of returning just one:

Quote::find(1)->pluck('id'); // --> [1, 2, 3, 4, ...]

Why is this happening?

Update

Strangely, the query:

Quote::where('id', 1)->pluck('id'); // --> [1]

works as expected.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire