{"action":"created","issue":{"url":"https://api.github.com/repos/DraperStudio/Laravel-Rewardable/issues/3","repository_url":"https://api.github.com/repos/DraperStudio/Laravel-Rewardable","labels_url":"https://api.github.com/repos/DraperStudio/Laravel-Rewardable/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/DraperStudio/Laravel-Rewardable/issues/3/comments","events_url":"https://api.github.com/repos/DraperStudio/Laravel-Rewardable/issues/3/events","html_url":"https://github.com/DraperStudio/Laravel-Rewardable/issues/3","id":132815314,"number":3,"title":"Help using rewardable","user":{"login":"simonfranz","id":1003559,"avatar_url":"https://avatars.githubusercontent.com/u/1003559?v=3","gravatar_id":"","url":"https://api.github.com/users/simonfranz","html_url":"https://github.com/simonfranz","followers_url":"https://api.github.com/users/simonfranz/followers","following_url":"https://api.github.com/users/simonfranz/following{/other_user}","gists_url":"https://api.github.com/users/simonfranz/gists{/gist_id}","starred_url":"https://api.github.com/users/simonfranz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonfranz/subscriptions","organizations_url":"https://api.github.com/users/simonfranz/orgs","repos_url":"https://api.github.com/users/simonfranz/repos","events_url":"https://api.github.com/users/simonfranz/events{/privacy}","received_events_url":"https://api.github.com/users/simonfranz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-02-10T20:55:24Z","updated_at":"2016-02-12T07:03:39Z","closed_at":null,"body":"Hi there,\r\nmaybe I'm misssing something, but I don't get the plugin to work.\r\n\r\nMy model looks like described in the index\r\n\r\n```\r\nuse DraperStudio\\Rewardable\\Traits\\Rewardable as RewardableTrait;\r\nuse Illuminate\\Auth\\Authenticatable;\r\nuse Illuminate\\Auth\\Passwords\\CanResetPassword;\r\nuse Illuminate\\Contracts\\Auth\\Authenticatable as AuthenticatableContract;\r\nuse Illuminate\\Contracts\\Auth\\CanResetPassword as CanResetPasswordContract;\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n\r\nclass User extends Model implements AuthenticatableContract, CanResetPasswordContract {\r\n\r\n\tuse Authenticatable, CanResetPassword, RewardableTrait;\r\n```\r\n\r\nI've also published the migraitons and have executed them.\r\nIn a view after the login I've tried to print all the gained credits (none at this time)\r\n`{{dump(Auth::user()->getCredit())}}`\r\nThe same happens if I'm getting a direct model object with\r\n`{{dump(\\App\\Models\\User::find(1)->getCredit())}}`\r\n\r\nSaldy I only get this Exception:\r\n```\r\nNext ErrorException: Call to undefined method Illuminate\\Database\\Query\\Builder::getCredit() (View: /home/s/www/test/resources/views/layouts/login.blade.php) (View: /home/s/www/test/resources/views/layouts/login.blade.php) (View: /home/s/www/test/resources/views/layouts/login.blade.php) (View: /home/s/www/test/resources/views/layouts/login.blade.php) in /home/s/www/test/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2093\r\nStack trace:\r\n#0 /home/s/www/test/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(44): Illuminate\\View\\Engines\\CompilerEngine->handleViewException(Object(ErrorException), 1)\r\n#1 /home/s/www/test/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(58): Illuminate\\View\\Engines\\PhpEngine->evaluatePath('/home/simon/www...', Array)\r\n#2 /home/s/www/test/vendor/laravel/framework/src/Illuminate/View/View.php(142): Illuminate\\View\\Engines\\CompilerEngine->get('/home/simon/www...', Array)\r\n#3 /home/s/www/test/vendor/laravel/framework/src/Illuminate/View/View.php(113): Illuminate\\View\\View->getContents()\r\n#4 /home/s/www/test/vendor/laravel/framework/src/Illuminate/View/View.php(82): Illuminate\\View\\View->renderContents()\r\n#5 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Http/Response.php(51): Illuminate\\View\\View->render()\r\n#6 /home/s/www/test/vendor/symfony/http-foundation/Response.php(198): Illuminate\\Http\\Response->setContent(Object(Illuminate\\View\\View))\r\n#7 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1229): Symfony\\Component\\HttpFoundation\\Response->__construct(Object(Illuminate\\View\\View))\r\n#8 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(112): Illuminate\\Routing\\Router->prepareResponse(Object(Illuminate\\Http\\Request), Object(Illuminate\\View\\View))\r\n#9 [internal function]: Illuminate\\Routing\\ControllerDispatcher->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))\r\n#10 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))\r\n#11 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))\r\n#12 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))\r\n#13 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(114): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))\r\n#14 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(67): Illuminate\\Routing\\ControllerDispatcher->callWithinStack(Object(App\\Http\\Controllers\\HomeController), Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request), 'index')\r\n#15 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Routing/Route.php(203): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request), 'App\\\\Http\\\\Contro...', 'index')\r\n#16 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Routing/Route.php(134): Illuminate\\Routing\\Route->runWithCustomDispatcher(Object(Illuminate\\Http\\Request))\r\n#17 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Routing/Router.php(708): Illuminate\\Routing\\Route->run(Object(Illuminate\\Http\\Request))\r\n#18 [internal function]: Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))\r\n#19 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))\r\n#20 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))\r\n#21 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))\r\n#22 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Routing/Router.php(710): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))\r\n#23 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Routing/Router.php(673): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))\r\n#24 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Routing/Router.php(635): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))\r\n#25 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(236): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))\r\n#26 [internal function]: Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))\r\n#27 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))\r\n#28 /home/s/www/test/app/Http/Middleware/SetLanguage.php(33): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))\r\n#29 [internal function]: App\\Http\\Middleware\\SetLanguage->handle(Object(Illuminate\\Http\\Request), Object(Closure))\r\n#30 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)\r\n#31 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))\r\n#32 /home/s/www/test/app/Http/Middleware/VerifyCsrfToken.php(17): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))\r\n#33 [internal function]: App\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))\r\n#34 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)\r\n#35 /home/s/www/test/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))\r\n#36 [internal function]: Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))\r\n#37 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)\r\n#38 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(62): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))\r\n#39 [internal function]: Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))\r\n#40 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)\r\n#41 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))\r\n#42 [internal function]: Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))\r\n#43 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)\r\n#44 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))\r\n#45 [internal function]: Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))\r\n#46 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)\r\n#47 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(44): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))\r\n#48 [internal function]: Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle(Object(Illuminate\\Http\\Request), Object(Closure))\r\n#49 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)\r\n#50 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))\r\n#51 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))\r\n#52 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(122): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))\r\n#53 /home/s/www/test/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(87): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))\r\n#54 /home/s/www/test/public/index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))\r\n#55 {main}\r\n```\r\n\r\nDid I miss something, could you maybe help me to get this working? It seems i might missed something integrating the package, but I don't get what's missing.\r\n\r\nRegards"},"comment":{"url":"https://api.github.com/repos/DraperStudio/Laravel-Rewardable/issues/comments/183205542","html_url":"https://github.com/DraperStudio/Laravel-Rewardable/issues/3#issuecomment-183205542","issue_url":"https://api.github.com/repos/DraperStudio/Laravel-Rewardable/issues/3","id":183205542,"user":{"login":"simonfranz","id":1003559,"avatar_url":"https://avatars.githubusercontent.com/u/1003559?v=3","gravatar_id":"","url":"https://api.github.com/users/simonfranz","html_url":"https://github.com/simonfranz","followers_url":"https://api.github.com/users/simonfranz/followers","following_url":"https://api.github.com/users/simonfranz/following{/other_user}","gists_url":"https://api.github.com/users/simonfranz/gists{/gist_id}","starred_url":"https://api.github.com/users/simonfranz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonfranz/subscriptions","organizations_url":"https://api.github.com/users/simonfranz/orgs","repos_url":"https://api.github.com/users/simonfranz/repos","events_url":"https://api.github.com/users/simonfranz/events{/privacy}","received_events_url":"https://api.github.com/users/simonfranz/received_events","type":"User","site_admin":false},"created_at":"2016-02-12T07:03:39Z","updated_at":"2016-02-12T07:03:39Z","body":"Thanks, I would appreciate it.\r\nPlease ask if you need any additional informations :-)"}}