Open johncarter- opened 2 years ago
If you create then delete a pivot model to sort of "initialise" the "table"/directory it works. See the follow up test in that branch.
I took a bit of source dive π€Ώ, but after a while trying to figure it out I didn't know my arse from my elbow. π€·ββοΈ
@johncarter- Yeah, the codebase is a bit messy right now. My 2.x branch is much cleaner, I think. This might be something I put on hold fixing until then though, it'll probably be a couple of weeks.
Do you need this functionality for a project right now?
Oh I didn't mean there was anything wrong with your code π― I just meant I was in over my head.
I can use the create and delete workaround for now, no pressure at allπ
@johncarter- Sweet!
When accessing empty model many to many relationships you get a
SQLSTATE[HY000]: General error: 1 no such table: the_pivot_table_name
exception.How to replicate
Clone https://github.com/johncarter-/laravel-orbit-many-to-many
Switch to the
issue/many-to-many-no-such-table
branch.Run
php artisan test --filter it_can_handle_empty_many_to_many_relationships tests/Feature/OrbitalManyToManyTest.php