Level 3
@anderking Eloquent doesn't support composite keys out the box. I would suggest inside your controller or by using middleware assigned to a route
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a many-to-many table of 'cost' with its autoincrementable id, but it also has as foreign keys the id_item and the id_proveedor, as I can avoid that a duplicate record with those combined foreign values is inserted.
@anderking Eloquent doesn't support composite keys out the box. I would suggest inside your controller or by using middleware assigned to a route
Please or to participate in this conversation.