peartreedigital / boilerplate

My boilerplate for multi-tenancy websites using Laravel 5.7 and Hyn/Tenancy 5.3. Highly based on the tutorial by Ashok Gelal (https://blog.usejournal.com/writing-a-full-featured-multi-tenant-laravel-app-from-scratch-a0e1a7350d9d, I've kept the name Townhouse to honor him) and on the collective work you can find on Discord's Tenancy server
14 stars 6 forks source link

Delete the correct website when deleting a tenant #4

Open HughVolpe opened 5 years ago

HughVolpe commented 5 years ago

When calling first() on the website object the first website in the database was being retrieved (it is not the relationship that was being accessed, so all websites could be accessed). This results in the wrong website being deleted when more than one tenant had been created and the more recent tenant deleted.

diegomagikal commented 5 years ago

Please accept this PR! This error is explained here: https://github.com/hyn/multi-tenant/issues/674