Eloquent Trick to get amazing speeds with polymorphic relationship queries using compound indices.
Common Table Expressions are incredibly useful in MySQL 8. However, Laravel does not support it out of the box. Let's see how we can use a package to support this.
The article includes the best way to understand a many to many relationship and write a migration.