There's absolutely no difference in the query between the two: get($cols)
and select($cols)->get()
.
The only difference is with the methods behaviour: get
accepts only array, while select
either array or multiple string params (that are grabbed to an array anyway).
If that is true, I don't know why it works in only one of those cases. It maybe has to do with other code that uses that variable. Anyway, thank you for clarifying the issue.
If that is true, I don't know why it works in only one of those cases. It maybe has to do with other code that uses that variable. Anyway, thank you for clarifying the issue.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community