To add a query on relational data in Laravel, you can use the Eloquent ORM provided by Laravel. Eloquent allows you to define relationships between your models and easily query related data.You can use methods such as with, whereHas, and has to query related data. For example, if you have a User model that has a one-to-many relationship with a Post model, you can use the with method to eager load the related posts when querying users.