The problem is not naming 1st table key and 2nd table foreign key the same, but that you don't comply the naming convention for Eloquent models.
Eloquent will check for the id
as a primary key if you don't specify it explicitly, so this should work for you (though I suggest not naming those columns the same anyway):
// Credit model
protected $primaryKey = 'product_id';
To make it clear - your code is not joining tables but runs another query with where in
clause, and Laravel should fetch the related rows correctly. The problem is with matching fetched results to their Credit
parents later, that's why you get null
there.