Is is possible to pluck a translated name as key?
horaceho opened this issue · comments
Horace Ho commented
Tag::where('type', 'Groups')->pluck('name', 'name');
What I get:
Illuminate\Support\Collection {
all: [
"{"en": "A", "zh": "甲"}" => "A",
"{"en": "B", "zh": "乙"}" => "B",
],
}
What I want:
Illuminate\Support\Collection {
all: [
"A" => "A",
"B" => "B",
],
}
Thanks for the great package!
Horace Ho commented
My bad. Should be:
Tag::where('type', 'Groups')->get()->pluck('name', 'name');