{"action":"created","issue":{"url":"https://api.github.com/repos/bestmomo/laravel5-example/issues/39","labels_url":"https://api.github.com/repos/bestmomo/laravel5-example/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/bestmomo/laravel5-example/issues/39/comments","events_url":"https://api.github.com/repos/bestmomo/laravel5-example/issues/39/events","html_url":"https://github.com/bestmomo/laravel5-example/issues/39","id":120721045,"number":39,"title":"  ErrorException in UserRepository.php line 53","user":{"login":"chenchaochen","id":13834948,"avatar_url":"https://avatars.githubusercontent.com/u/13834948?v=3","gravatar_id":"","url":"https://api.github.com/users/chenchaochen","html_url":"https://github.com/chenchaochen","followers_url":"https://api.github.com/users/chenchaochen/followers","following_url":"https://api.github.com/users/chenchaochen/following{/other_user}","gists_url":"https://api.github.com/users/chenchaochen/gists{/gist_id}","starred_url":"https://api.github.com/users/chenchaochen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenchaochen/subscriptions","organizations_url":"https://api.github.com/users/chenchaochen/orgs","repos_url":"https://api.github.com/users/chenchaochen/repos","events_url":"https://api.github.com/users/chenchaochen/events{/privacy}","received_events_url":"https://api.github.com/users/chenchaochen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-07T08:12:56Z","updated_at":"2015-12-07T09:04:20Z","closed_at":null,"body":"Hi, \r\n\r\nWhen I registered a new user, I got the error messages as below. \r\n\r\nErrorException in UserRepository.php line 53\r\nTrying to get property of non-object\r\n\r\n1. in UserRepository.php line 53\r\n2.at HandleExceptions->handleError('8', 'Trying to get property of non-object', 'C:\\xampp\\htdocs\\laravel5-example\\app\\Repositories\\UserRepository.php', '53', array('user' => object(User), 'inputs' => array('_token' => 'ETs1bfntR5oslSfENuxHHhhXorNaJY1WPQxHwzt9', 'username' => 'Evans', 'email' => 'evans.daoapp@gmail.com', 'password' => '12qwaszx', 'password_confirmation' => '12qwaszx', 'address' => ''), 'role_user' => null)) in UserRepository.php line 53\r\n3.at UserRepository->save(object(User), array('_token' => 'ETs1bfntR5oslSfENuxHHhhXorNaJY1WPQxHwzt9', 'username' => 'Evans', 'email' => 'evans.daoapp@gmail.com', 'password' => '12qwaszx', 'password_confirmation' => '12qwaszx', 'address' => '')) in UserRepository.php line 145\r\n4.at UserRepository->store(array('_token' => 'ETs1bfntR5oslSfENuxHHhhXorNaJY1WPQxHwzt9', 'username' => 'Evans', 'email' => 'evans.daoapp@gmail.com', 'password' => '12qwaszx', 'password_confirmation' => '12qwaszx', 'address' => ''), 'J2wwFd2WPsWM0g8BaQb51DxbCPa2lM') in AuthController.php line 108\r\n5.at AuthController->postRegister(object(RegisterRequest), object(UserRepository))\r\n6.at call_user_func_array(array(object(AuthController), 'postRegister'), array(object(RegisterRequest), object(UserRepository))) in Controller.php line 256\r\n7.at Controller->callAction('postRegister', array(object(RegisterRequest), object(UserRepository))) in ControllerDispatcher.php line 164\r\n8.at ControllerDispatcher->call(object(AuthController), object(Route), 'postRegister') in ControllerDispatcher.php line 112\r\n9.at ControllerDispatcher->Illuminate\\Routing\\{closure}(object(Request))\r\n10.at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139\r\n11.at Pipeline->Illuminate\\Pipeline\\{closure}(object(Request)) in RedirectIfAuthenticated.php line 41\r\n12.at RedirectIfAuthenticated->handle(object(Request), object(Closure))\r\n13.at call_user_func_array(array(object(RedirectIfAuthenticated), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124\r\n14.at Pipeline->Illuminate\\Pipeline\\{closure}(object(Request))\r\n15.at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103\r\n16.at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 114\r\n17.at ControllerDispatcher->callWithinStack(object(AuthController), object(Route), object(Request), 'postRegister') in ControllerDispatcher.php line 69\r\n18.at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\\Http\\Controllers\\Auth\\AuthController', 'postRegister') in Route.php line 203\r\n19.at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134\r\n20.at Route->run(object(Request)) in Router.php line 708\r\n21.at Router->Illuminate\\Routing\\{closure}(object(Request))\r\n22.at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139\r\n23.at Pipeline->Illuminate\\Pipeline\\{closure}(object(Request))\r\n24.at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103\r\n25.at Pipeline->then(object(Closure)) in Router.php line 710\r\n26.at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 675\r\n27.at Router->dispatchToRoute(object(Request)) in Router.php line 635\r\n28.at Router->dispatch(object(Request)) in Kernel.php line 236\r\n29.at Kernel->Illuminate\\Foundation\\Http\\{closure}(object(Request))\r\n30.at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139\r\n31.at Pipeline->Illuminate\\Pipeline\\{closure}(object(Request)) in App.php line 56\r\n32.at App->handle(object(Request), object(Closure))\r\n33.at call_user_func_array(array(object(App), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124\r\n34.at Pipeline->Illuminate\\Pipeline\\{closure}(object(Request)) in VerifyCsrfToken.php line 50\r\n35.at VerifyCsrfToken->handle(object(Request), object(Closure)) in VerifyCsrfToken.php line 17\r\n36.at VerifyCsrfToken->handle(object(Request), object(Closure))\r\n37.at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124\r\n38.at Pipeline->Illuminate\\Pipeline\\{closure}(object(Request)) in ShareErrorsFromSession.php line 49\r\n39.at ShareErrorsFromSession->handle(object(Request), object(Closure))\r\n40.at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124\r\n41.at Pipeline->Illuminate\\Pipeline\\{closure}(object(Request)) in StartSession.php line 62\r\n42.at StartSession->handle(object(Request), object(Closure))\r\n43.at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124\r\n44.at Pipeline->Illuminate\\Pipeline\\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37\r\n45.at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))\r\n46.at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124\r\n47.at Pipeline->Illuminate\\Pipeline\\{closure}(object(Request)) in EncryptCookies.php line 59\r\n48.at EncryptCookies->handle(object(Request), object(Closure))\r\n49.at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124\r\n50.at Pipeline->Illuminate\\Pipeline\\{closure}(object(Request)) in CheckForMaintenanceMode.php line 44\r\n51.at CheckForMaintenanceMode->handle(object(Request), object(Closure))\r\n52.at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124\r\n53.at Pipeline->Illuminate\\Pipeline\\{closure}(object(Request))\r\n54.at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103\r\n55.at Pipeline->then(object(Closure)) in Kernel.php line 122\r\n56.at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87\r\n57.at Kernel->handle(object(Request)) in index.php line 53\r\n\r\nIs anything I need to edit or fix?\r\nThanks"},"comment":{"url":"https://api.github.com/repos/bestmomo/laravel5-example/issues/comments/162453724","html_url":"https://github.com/bestmomo/laravel5-example/issues/39#issuecomment-162453724","issue_url":"https://api.github.com/repos/bestmomo/laravel5-example/issues/39","id":162453724,"user":{"login":"bestmomo","id":2959682,"avatar_url":"https://avatars.githubusercontent.com/u/2959682?v=3","gravatar_id":"","url":"https://api.github.com/users/bestmomo","html_url":"https://github.com/bestmomo","followers_url":"https://api.github.com/users/bestmomo/followers","following_url":"https://api.github.com/users/bestmomo/following{/other_user}","gists_url":"https://api.github.com/users/bestmomo/gists{/gist_id}","starred_url":"https://api.github.com/users/bestmomo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bestmomo/subscriptions","organizations_url":"https://api.github.com/users/bestmomo/orgs","repos_url":"https://api.github.com/users/bestmomo/repos","events_url":"https://api.github.com/users/bestmomo/events{/privacy}","received_events_url":"https://api.github.com/users/bestmomo/received_events","type":"User","site_admin":false},"created_at":"2015-12-07T09:04:20Z","updated_at":"2015-12-07T09:04:20Z","body":"Hi,\r\n\r\nLooks like there is something weird with your roles. What did you change on them ?\r\n\r\nCheck if you get something on line 52 in `UserRepository` :\r\n```\r\n$role_user = $this->role->where('slug', 'user')->first();\r\ndd($role_user);\r\n```"}}