{"action":"created","issue":{"url":"https://api.github.com/repos/overtrue/laravel-follow/issues/37","repository_url":"https://api.github.com/repos/overtrue/laravel-follow","labels_url":"https://api.github.com/repos/overtrue/laravel-follow/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/overtrue/laravel-follow/issues/37/comments","events_url":"https://api.github.com/repos/overtrue/laravel-follow/issues/37/events","html_url":"https://github.com/overtrue/laravel-follow/issues/37","id":303007345,"number":37,"title":"Nothing added to database","user":{"login":"shrikanth003","id":22520139,"avatar_url":"https://avatars3.githubusercontent.com/u/22520139?v=4","gravatar_id":"","url":"https://api.github.com/users/shrikanth003","html_url":"https://github.com/shrikanth003","followers_url":"https://api.github.com/users/shrikanth003/followers","following_url":"https://api.github.com/users/shrikanth003/following{/other_user}","gists_url":"https://api.github.com/users/shrikanth003/gists{/gist_id}","starred_url":"https://api.github.com/users/shrikanth003/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shrikanth003/subscriptions","organizations_url":"https://api.github.com/users/shrikanth003/orgs","repos_url":"https://api.github.com/users/shrikanth003/repos","events_url":"https://api.github.com/users/shrikanth003/events{/privacy}","received_events_url":"https://api.github.com/users/shrikanth003/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-03-07T08:35:05Z","updated_at":"2018-03-07T11:04:14Z","closed_at":null,"author_association":"NONE","body":"I have tried the following but it doesn't work\r\n\r\n`\r\npublic function followProfessional($slug)\r\n    {\r\n      $professional = Professional::where('slug', $slug)->first();\r\n      if(! $professional) {\r\n\r\n         return redirect()->back()->with('error', 'Professional does not exist.');\r\n       }\r\n\r\n      $user = Auth::user()->id;\r\n      $user->follow($professional);\r\n      return redirect()->back()->with('success', 'You are currently following this professional.');\r\n    }\r\n`\r\n\r\nAnd in my view \r\n\r\n`\r\n<a href=\"{{ url('professionals/'.$professional->category->slug.'/'.$professional->slug.'/follow') }}\" class=\"btn btn-sm white\">Follow</a>\r\n`\r\n\r\nAnd in my route\r\n`Route::get('professionals/{professionalcategory}/{slug}/follow', 'ProfessionalController@followProfessional')->name('professional.follow');`\r\n\r\nWhen i click on the follow button the page just refreshes back but doesn't add anything to the followables table\r\n\r\nCould anyone help me out in this?"},"comment":{"url":"https://api.github.com/repos/overtrue/laravel-follow/issues/comments/371103988","html_url":"https://github.com/overtrue/laravel-follow/issues/37#issuecomment-371103988","issue_url":"https://api.github.com/repos/overtrue/laravel-follow/issues/37","id":371103988,"user":{"login":"shrikanth003","id":22520139,"avatar_url":"https://avatars3.githubusercontent.com/u/22520139?v=4","gravatar_id":"","url":"https://api.github.com/users/shrikanth003","html_url":"https://github.com/shrikanth003","followers_url":"https://api.github.com/users/shrikanth003/followers","following_url":"https://api.github.com/users/shrikanth003/following{/other_user}","gists_url":"https://api.github.com/users/shrikanth003/gists{/gist_id}","starred_url":"https://api.github.com/users/shrikanth003/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shrikanth003/subscriptions","organizations_url":"https://api.github.com/users/shrikanth003/orgs","repos_url":"https://api.github.com/users/shrikanth003/repos","events_url":"https://api.github.com/users/shrikanth003/events{/privacy}","received_events_url":"https://api.github.com/users/shrikanth003/received_events","type":"User","site_admin":false},"created_at":"2018-03-07T11:04:14Z","updated_at":"2018-03-07T11:04:14Z","author_association":"NONE","body":"That adds a record in the database when i followed your code and tested in tinker\r\n"}}
{"actor":{"display_login":"shrikanth003"}}