Yeah, it's perfectly fine to add additional columns to pivot tables.
If you want to retrieve those columns whenever your relationship is queried, you need to use a withPivot.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
hi every one. i want to make laravel database tables from existing schema. but i confused is it ok to add pivot table with exta fields like data fields for:example role-start-date, and role-end-date. this is the image for the schema i want to create, as you can see apart from, roles table , and staffs table staff-role table is pivot table, but it has extra columns for dates to select. how can i make that pivot table with extra date fields that user can select from input date form. thanks. the image is the link below https://www.vertabelo.com/blog/a-database-model-for-gallery-or-museum-management/model.png
@xuuto If you are talking about technicality, the attach method on BelongsToMany relations accept an array argument in which you can provide those additional columns.
Otherwise, I can't tell you how you want to get that data. It's up to you or the business.
Please or to participate in this conversation.