Name of the primary key column in any model in Laravel framework is id
protected $primaryKey = 'id';
And I know I can change that default name like this:
protected $primaryKey = 'new_name';
My question is: What if I have a composite key (2 or more columns) in the table, how do I add them as the $primaryKey
? And do I really have to define them?