Pluck could have been retrieved as query but how? #1326
-
I have a statement which gets a list of users as an array User::select('name')->get()->pluck('name')->toArray() This results in: [
"Test",
"Reviewer",
] Larastan gives the following error:
If I don't use the pluck using [
[
"name" => "Test",
],
[
"name" => "Reviewer",
],
] I checked the Rules at https://github.com/nunomaduro/larastan/blob/master/docs/rules.md#examples-1 but that only shows an example where existence is checked. So what query do I use to get the array like I desired above? |
Beta Was this translation helpful? Give feedback.
Answered by
szepeviktor
Aug 5, 2022
Replies: 1 comment 4 replies
-
How about |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
szepeviktor
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How about
User::select('name')->pluck('name')->get()->toArray()
?