reliese / laravel

Reliese Laravel Model Generator
MIT License
1.49k stars 316 forks source link

Update ReferenceFactory.php #276

Closed antevgen closed 7 months ago

antevgen commented 7 months ago

227

XedinUnknown commented 7 months ago

Fixes this problem by limiting replacements in the pivot name, causing only the first occurrence of the first table name to be removed from the pivot table name, which makes the correct pivot name that passes checks in the intended way.

Seems that this may simply have been an oversight, and manifests only if the name of one table contains the name of the other, like when relating goals to primary_goals via a goals_primary_goals table.

CristianLlanos commented 7 months ago

Great catch 🙌. Thanks for sharing!