You can name your tables however you like, you just have to setup your Eloquent models correctly.
Set the $table property on the model and set the second parameter on your belongsToMany() relationship to change the default table names.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello ,
I have two tables with two models (Many To Many relation ship)
table 1 : tasks
table 2: the name is "task types"
table 3: pivot table which the name is something like :"task_task_type"
My question is :
When the name of table is composed is it possible to use camel case and the tables names will be :
tasks taskTypes task_tasktype
OR
tasks task_types task_task_type
Thanks
Please or to participate in this conversation.