{"action":"created","issue":{"url":"https://api.github.com/repos/laracasts/TestDummy/issues/77","labels_url":"https://api.github.com/repos/laracasts/TestDummy/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/laracasts/TestDummy/issues/77/comments","events_url":"https://api.github.com/repos/laracasts/TestDummy/issues/77/events","html_url":"https://github.com/laracasts/TestDummy/issues/77","id":60792623,"number":77,"title":"Overrides don't work with relations","user":{"login":"bobbybouwmann","id":5872362,"avatar_url":"https://avatars.githubusercontent.com/u/5872362?v=3","gravatar_id":"","url":"https://api.github.com/users/bobbybouwmann","html_url":"https://github.com/bobbybouwmann","followers_url":"https://api.github.com/users/bobbybouwmann/followers","following_url":"https://api.github.com/users/bobbybouwmann/following{/other_user}","gists_url":"https://api.github.com/users/bobbybouwmann/gists{/gist_id}","starred_url":"https://api.github.com/users/bobbybouwmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobbybouwmann/subscriptions","organizations_url":"https://api.github.com/users/bobbybouwmann/orgs","repos_url":"https://api.github.com/users/bobbybouwmann/repos","events_url":"https://api.github.com/users/bobbybouwmann/events{/privacy}","received_events_url":"https://api.github.com/users/bobbybouwmann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-12T09:40:24Z","updated_at":"2015-03-14T20:53:21Z","closed_at":null,"body":"So here is the issue. I have a user which has one role (role_id). When I create the user with TestDummy with overrides it gives an error while it creating the associated role!\r\n\r\nThis is my setup\r\n```\r\n// tests/factories/factories.php\r\n\r\n$factory('App\\User', [\r\n    'name' => $faker->name,\r\n    'email' => $faker->email,\r\n    'password' => $faker->word,\r\n    'role_id' => 'factory:Sebwite\\Entry\\Models\\Role',\r\n    'created_at' => $faker->date(),\r\n    'updated_at' => $faker->date()\r\n]);\r\n\r\n$factory('Sebwite\\Entry\\Models\\Role', [\r\n    'name' => $faker->name,\r\n    'display_name' => $faker->name,\r\n    'description' => $faker->sentence(),\r\n    'created_at' => $faker->date(),\r\n    'updated_at' => $faker->date()\r\n]);\r\n```\r\n> Note that the Role model is from a package, but I think it shouldn't matter since it's namespaced correctly.\r\n\r\nAnd now the test part\r\n```\r\n// tests/_support/FunctionalHelper\r\n\r\n public function signIn()\r\n{\r\n        $email = 'foo@example.com';\r\n        $password = 'password';\r\n        $this->haveAnAccount(compact('email', 'password'));\r\n\r\n        $I = $this->getModule('Laravel5');\r\n\r\n        $I->amOnPage('/login');\r\n        $I->fillField('email', $email);\r\n        $I->fillField('password', $password);\r\n        $I->click('Login');\r\n}\r\n\r\npublic function haveAnAccount($overrides = [])\r\n{\r\n        return TestDummy::create('App\\User', $overrides);\r\n}\r\n```` \r\n\r\nThis is the error\r\n```\r\nIlluminate\\Database\\QueryException: SQLSTATE[HY000]: General error: 1 table roles has no column named password (SQL: insert into \"roles\" (\"name\", \"display_name\", \"description\", \"created_at\", \"updated_at\", \"email\", \"password\") values (Vince Graham, Camila Mayert, Quis molestiae laboriosam id ea expedita., 2010-11-30 00:00:00, 1998-08-18 00:00:00, foo@example.com, password))\r\n```\r\nAs you can see in the error it tries to insert the overrides for the User model in the Role model, while that shouldn't be happening! \r\n\r\nIf you need anything else please let me know!"},"comment":{"url":"https://api.github.com/repos/laracasts/TestDummy/issues/comments/80717408","html_url":"https://github.com/laracasts/TestDummy/issues/77#issuecomment-80717408","issue_url":"https://api.github.com/repos/laracasts/TestDummy/issues/77","id":80717408,"user":{"login":"noleafclover614","id":8203609,"avatar_url":"https://avatars.githubusercontent.com/u/8203609?v=3","gravatar_id":"","url":"https://api.github.com/users/noleafclover614","html_url":"https://github.com/noleafclover614","followers_url":"https://api.github.com/users/noleafclover614/followers","following_url":"https://api.github.com/users/noleafclover614/following{/other_user}","gists_url":"https://api.github.com/users/noleafclover614/gists{/gist_id}","starred_url":"https://api.github.com/users/noleafclover614/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noleafclover614/subscriptions","organizations_url":"https://api.github.com/users/noleafclover614/orgs","repos_url":"https://api.github.com/users/noleafclover614/repos","events_url":"https://api.github.com/users/noleafclover614/events{/privacy}","received_events_url":"https://api.github.com/users/noleafclover614/received_events","type":"User","site_admin":false},"created_at":"2015-03-14T20:53:21Z","updated_at":"2015-03-14T20:53:21Z","body":"I also just started experiencing this behavior."}}