{"action":"created","issue":{"url":"https://api.github.com/repos/404labfr/laravel-impersonate/issues/19","repository_url":"https://api.github.com/repos/404labfr/laravel-impersonate","labels_url":"https://api.github.com/repos/404labfr/laravel-impersonate/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/404labfr/laravel-impersonate/issues/19/comments","events_url":"https://api.github.com/repos/404labfr/laravel-impersonate/issues/19/events","html_url":"https://github.com/404labfr/laravel-impersonate/issues/19","id":236746826,"number":19,"title":"Route::impersonate() returns Undefined offset: 0","user":{"login":"gassius","id":14284346,"avatar_url":"https://avatars2.githubusercontent.com/u/14284346?v=3","gravatar_id":"","url":"https://api.github.com/users/gassius","html_url":"https://github.com/gassius","followers_url":"https://api.github.com/users/gassius/followers","following_url":"https://api.github.com/users/gassius/following{/other_user}","gists_url":"https://api.github.com/users/gassius/gists{/gist_id}","starred_url":"https://api.github.com/users/gassius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gassius/subscriptions","organizations_url":"https://api.github.com/users/gassius/orgs","repos_url":"https://api.github.com/users/gassius/repos","events_url":"https://api.github.com/users/gassius/events{/privacy}","received_events_url":"https://api.github.com/users/gassius/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-06-18T21:29:54Z","updated_at":"2017-06-18T22:12:25Z","closed_at":null,"body":"Hi,\r\n\r\nI am trying to use your package and I am having some trouble with the Macro Route.\r\n\r\nWhen I incude the macro route in my routes/web.php `Route::impersonate();` I get this error:\r\n\r\nErrorException in Router.php line 1085: Undefined offset: 0\r\n\r\nAny ideas on what I am doing wrong? Kind regards"},"comment":{"url":"https://api.github.com/repos/404labfr/laravel-impersonate/issues/comments/309306379","html_url":"https://github.com/404labfr/laravel-impersonate/issues/19#issuecomment-309306379","issue_url":"https://api.github.com/repos/404labfr/laravel-impersonate/issues/19","id":309306379,"user":{"login":"gassius","id":14284346,"avatar_url":"https://avatars2.githubusercontent.com/u/14284346?v=3","gravatar_id":"","url":"https://api.github.com/users/gassius","html_url":"https://github.com/gassius","followers_url":"https://api.github.com/users/gassius/followers","following_url":"https://api.github.com/users/gassius/following{/other_user}","gists_url":"https://api.github.com/users/gassius/gists{/gist_id}","starred_url":"https://api.github.com/users/gassius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gassius/subscriptions","organizations_url":"https://api.github.com/users/gassius/orgs","repos_url":"https://api.github.com/users/gassius/repos","events_url":"https://api.github.com/users/gassius/events{/privacy}","received_events_url":"https://api.github.com/users/gassius/received_events","type":"User","site_admin":false},"created_at":"2017-06-18T22:12:25Z","updated_at":"2017-06-18T22:12:25Z","body":"Also, maybe related, maybe not. I not using the Macro Route, and I created a function in my UserController\r\n\r\n```\r\n    public function impersonate($id)\r\n    {\r\n      Auth::user()->impersonate($id);\r\n    }\r\n```\r\nAnd created a route to it:\r\n\r\n`Route::get('profile/impersonate/{id}', 'Common\\UserController@impersonate')->name('admin.impersonate');`\r\n\r\nWhen I click on the corresponding button I get this error:\r\n\r\nBadMethodCallException\r\n\r\nCall to undefined method Illuminate\\Database\\Query\\Builder::impersonate()\r\nin Builder.php (line 2450)\r\nat Builder->__call('impersonate', array('2'))in Builder.php (line 1250)\r\nat Builder->__call('impersonate', array('2'))in Model.php (line 1357)\r\nat Model->__call('impersonate', array('2'))in UserController.php (line 167)\r\nat UserController->impersonate('2')\r\nat call_user_func_array(array(object(UserController), 'impersonate'), array('id' => '2'))in Controller.php (line 55)\r\nat Controller->callAction('impersonate', array('id' => '2'))in ControllerDispatcher.php (line 44)\r\n\r\nIn my User model I included the trait as:\r\n\r\n```\r\nnamespace App;\r\n\r\nuse App\\Notifications\\ResetPassword;\r\nuse Illuminate\\Notifications\\Notifiable;\r\nuse Illuminate\\Foundation\\Auth\\User as Authenticatable;\r\nuse Lab404\\Impersonate\\Models\\Impersonate;\r\n\r\nclass User extends Authenticatable\r\n```"}}
{"actor":{"display_login":"gassius"}}