Afraz Ahmad
Afraz Ahmad

Reputation: 5416

Laravel eloquent max function does not give correct value greater than 99,999

App\Employee::max('salary'); 

does not give max value if salary is greater than 99,999. Salary column type is string because salary column can contain salary amount or a text info.

What I can do to solve this issue ?

Thanks.

Upvotes: 1

Views: 810

Answers (1)

astratyandmitry
astratyandmitry

Reputation: 515

I might be wrong, but max SQL function can work only with numeric types. Try to switch from VARCHAR to FLOAT.

Upvotes: 1

Related Questions