Support the ongoing development of Laravel.io →
Database Eloquent

hi, im using this migration:

Migration

and this model:

Model

how do i specify the composite key in the model?? i tryed protected $primaryKey = ['trip_id','stop_id']; but gives error because it only accepts string! any suggestion ?

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

danielgek danielgek Joined 1 Dec 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.