In PHP artisan tinker I've setup some LabTest objects with a factory method. These are linked with TestCategory in a pivot table. All of these tables are generated via migration.
creates 75 lab tests like expected.
TestCategory class has a many-to-many relation with LabTest, but I already have the TestCategory data in a database dump file. So I don't need a factory. What I do need to be able to do is populate the pivot table (
lab_test_test_category table), but in order to do that I need to be able to query my existing test categories... and I can't. Why is this happening? If I generate them with a factory, I can see them. Why can't I see the data that's already in the database?
I know I can just build a new factory for the TestCategory rather than try and get this to work, and that's what I'm doing so that I can keep working, but its bugging my why its not working. can anyone help? I'm still pretty new to Laravel.