Table prefix was missing in BelongsToMany@getRelationCountQueryForSelfJo...

Table prefix was missing in the SQL query generated by Eloquent ORM, as discussed here : https://github.com/laravel/laravel/issues/2672

Hope I'm doing it right, never worked with pull requests !