Laravel OrderBy relationship counter

  • Published 2019-08-21 09:39:18
  • Author Riaz Uddin Masum
If you want to count the number of results from a relationship without actually loading them you may use the "withCount" method, which will place a "{relation}_count" column on your resulting models.   For example: ...
readmore