{"action":"created","issue":{"url":"https://api.github.com/repos/LaravelRUS/SleepingOwlAdmin/issues/314","repository_url":"https://api.github.com/repos/LaravelRUS/SleepingOwlAdmin","labels_url":"https://api.github.com/repos/LaravelRUS/SleepingOwlAdmin/issues/314/labels{/name}","comments_url":"https://api.github.com/repos/LaravelRUS/SleepingOwlAdmin/issues/314/comments","events_url":"https://api.github.com/repos/LaravelRUS/SleepingOwlAdmin/issues/314/events","html_url":"https://github.com/LaravelRUS/SleepingOwlAdmin/issues/314","id":184814196,"number":314,"title":"Extra Column (L5.2)","user":{"login":"macedodebrito","id":8905347,"avatar_url":"https://avatars.githubusercontent.com/u/8905347?v=3","gravatar_id":"","url":"https://api.github.com/users/macedodebrito","html_url":"https://github.com/macedodebrito","followers_url":"https://api.github.com/users/macedodebrito/followers","following_url":"https://api.github.com/users/macedodebrito/following{/other_user}","gists_url":"https://api.github.com/users/macedodebrito/gists{/gist_id}","starred_url":"https://api.github.com/users/macedodebrito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macedodebrito/subscriptions","organizations_url":"https://api.github.com/users/macedodebrito/orgs","repos_url":"https://api.github.com/users/macedodebrito/repos","events_url":"https://api.github.com/users/macedodebrito/events{/privacy}","received_events_url":"https://api.github.com/users/macedodebrito/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-24T11:23:45Z","updated_at":"2016-10-24T14:00:42Z","closed_at":null,"body":"Hello everyone.\r\n\r\nhow can i add extra column (virtual one), to a query ?\r\n\r\nits only for display, i wont need to \"edit\" it\r\nIm using this query: \r\n\r\n`$query->whereIn($array);`\r\n\r\nbut i need one(or more) extra columns, basicaly they are math equations\r\nThey arent inside the database. i need to add them virtually\r\n\r\nAny idea? \r\n\r\nThanks,\r\n- Brito"},"comment":{"url":"https://api.github.com/repos/LaravelRUS/SleepingOwlAdmin/issues/comments/255748625","html_url":"https://github.com/LaravelRUS/SleepingOwlAdmin/issues/314#issuecomment-255748625","issue_url":"https://api.github.com/repos/LaravelRUS/SleepingOwlAdmin/issues/314","id":255748625,"user":{"login":"AndreyBobrov","id":9943539,"avatar_url":"https://avatars.githubusercontent.com/u/9943539?v=3","gravatar_id":"","url":"https://api.github.com/users/AndreyBobrov","html_url":"https://github.com/AndreyBobrov","followers_url":"https://api.github.com/users/AndreyBobrov/followers","following_url":"https://api.github.com/users/AndreyBobrov/following{/other_user}","gists_url":"https://api.github.com/users/AndreyBobrov/gists{/gist_id}","starred_url":"https://api.github.com/users/AndreyBobrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndreyBobrov/subscriptions","organizations_url":"https://api.github.com/users/AndreyBobrov/orgs","repos_url":"https://api.github.com/users/AndreyBobrov/repos","events_url":"https://api.github.com/users/AndreyBobrov/events{/privacy}","received_events_url":"https://api.github.com/users/AndreyBobrov/received_events","type":"User","site_admin":false},"created_at":"2016-10-24T14:00:42Z","updated_at":"2016-10-24T14:00:42Z","body":"If you need to filter results by additional non-existing fields, you can retrieve records and than work with collection of results, using methods like \"filter\" or \"reject\":\r\n\r\n```\r\n$users = App\\User::where('active', 1)->get();\r\n$users = $users->filter(function($user, $key) {\r\n    return SomeMath($user->field) > 10;\r\n});\r\n```\r\n\r\nIf you need to calculate some non-existing fields and append them to resulting models, you can use Eloquent accessors.\r\n\r\n```\r\nfunction getVirtualFieldAttribute()\r\n{\r\n    return SomeMath($this->field);\r\n}\r\n```\r\n```\r\ndump($user->virtual_field);\r\n```"}}
{"actor":{"display_login":"AndreyBobrov"}}