I have the following MySQL query and I would like to change it to the correct format for Laravel's Query builder.
SELECT DISTINCT(colors) FROM `cards` ORDER BY LENGTH(colors) DESC
This is what I currently have:
table('cards')
->orderBy(LENGTH(colors), 'desc')
->get();
LENGTH(colors)would need to be in quotes, since it is a string and not a PHP function?