Daily Archives: 11/18/2020

Order by Array

Sample

Reference

  1. https://stackoverflow.com/questions/8055138/mysql-sort-order-by-array-value
  2. https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_field
  3. Could be replaced with orderRaw()
    https://laravel.com/docs/8.x/queries