{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/14898","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/14898/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/14898/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/14898/events","html_url":"https://github.com/laravel/framework/issues/14898","id":172122733,"number":14898,"title":"[5.3] Error after updating with eager loading","user":{"login":"infernobass7","id":6399755,"avatar_url":"https://avatars.githubusercontent.com/u/6399755?v=3","gravatar_id":"","url":"https://api.github.com/users/infernobass7","html_url":"https://github.com/infernobass7","followers_url":"https://api.github.com/users/infernobass7/followers","following_url":"https://api.github.com/users/infernobass7/following{/other_user}","gists_url":"https://api.github.com/users/infernobass7/gists{/gist_id}","starred_url":"https://api.github.com/users/infernobass7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infernobass7/subscriptions","organizations_url":"https://api.github.com/users/infernobass7/orgs","repos_url":"https://api.github.com/users/infernobass7/repos","events_url":"https://api.github.com/users/infernobass7/events{/privacy}","received_events_url":"https://api.github.com/users/infernobass7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-19T12:40:21Z","updated_at":"2016-08-19T13:49:27Z","closed_at":null,"body":"After I updated to Laravel 5.3, I get the following error when trying to eager load.\r\n\r\n```\r\n[2016-08-19 08:38:04] local.ERROR: Symfony\\Component\\Debug\\Exception\\FatalThrowableError: Call to a member function all() on array in /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:617\r\nStack trace:\r\n#0 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(322): Illuminate\\Database\\Eloquent\\Builder->getModels(Array)\r\n#1 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(632): Illuminate\\Database\\Eloquent\\Builder->get(Array)\r\n#2 /home/vagrant/data-ms/app/Providers/AuthServiceProvider.php(45): Illuminate\\Database\\Eloquent\\Model::all()\r\n#3 /home/vagrant/data-ms/app/Providers/AuthServiceProvider.php(36): App\\Providers\\AuthServiceProvider->getPermissions()\r\n#4 [internal function]: App\\Providers\\AuthServiceProvider->boot(Object(Illuminate\\Auth\\Access\\Gate))\r\n#5 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array)\r\n#6 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(759): Illuminate\\Container\\Container->call(Array)\r\n#7 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(742): Illuminate\\Foundation\\Application->bootProvider(Object(App\\Providers\\AuthServiceProvider))\r\n#8 [internal function]: Illuminate\\Foundation\\Application->Illuminate\\Foundation\\{closure}(Object(App\\Providers\\AuthServiceProvider), 18)\r\n#9 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(743): array_walk(Array, Object(Closure))\r\n#10 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\\Foundation\\Application->boot()\r\n#11 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(203): Illuminate\\Foundation\\Bootstrap\\BootProviders->bootstrap(Object(Illuminate\\Foundation\\Application))\r\n#12 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(249): Illuminate\\Foundation\\Application->bootstrapWith(Array)\r\n#13 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\\Foundation\\Http\\Kernel->bootstrap()\r\n#14 /home/vagrant/data-ms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))\r\n#15 /home/vagrant/data-ms/public/index.php(53): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))\r\n#16 {main}  \r\n```\r\n\r\nHere is the spot that the code fails:\r\n```\r\n    protected function getPermissions()\r\n    {\r\n        return Permission::with('groups')->get();\r\n    }\r\n```\r\nSwitching it to the following gives the same error:\r\n```\r\n    protected function getPermissions()\r\n    {\r\n        return Permission::all()->load('groups');\r\n    }\r\n```"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/241023210","html_url":"https://github.com/laravel/framework/issues/14898#issuecomment-241023210","issue_url":"https://api.github.com/repos/laravel/framework/issues/14898","id":241023210,"user":{"login":"GrahamCampbell","id":2829600,"avatar_url":"https://avatars.githubusercontent.com/u/2829600?v=3","gravatar_id":"","url":"https://api.github.com/users/GrahamCampbell","html_url":"https://github.com/GrahamCampbell","followers_url":"https://api.github.com/users/GrahamCampbell/followers","following_url":"https://api.github.com/users/GrahamCampbell/following{/other_user}","gists_url":"https://api.github.com/users/GrahamCampbell/gists{/gist_id}","starred_url":"https://api.github.com/users/GrahamCampbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrahamCampbell/subscriptions","organizations_url":"https://api.github.com/users/GrahamCampbell/orgs","repos_url":"https://api.github.com/users/GrahamCampbell/repos","events_url":"https://api.github.com/users/GrahamCampbell/events{/privacy}","received_events_url":"https://api.github.com/users/GrahamCampbell/received_events","type":"User","site_admin":false},"created_at":"2016-08-19T13:49:27Z","updated_at":"2016-08-19T13:49:27Z","body":"What does your groups method look like?"}}
{"actor":{"display_login":"GrahamCampbell"}}