Delete models with composite primary key

Hello I have table with two integer fields game_id platform_id, this table is needed to implement many to many relation. I want to delete a row from this table, but did not find a way how.

$platforms = GamePlatform::find([
    'conditions' => 'game_id = :gid:',
    'bind' => ['gid' => $game->id],
]);

$platforms->delete();

I have this error: A primary key must be defined in the model in order to perform the operation



81.7k

Does your table have a primary key defined?