/** * @return Collection */ public function getIDsThatRequireNames() { // IDs need to be strings in the json for the comparison... return DragonType::where('name', 1)->pluck('id')->map(function ($item, $key) { return (string) $item; }); }