{"action":"opened","issue":{"url":"https://api.github.com/repos/yajra/laravel-datatables/issues/748","repository_url":"https://api.github.com/repos/yajra/laravel-datatables","labels_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/748/labels{/name}","comments_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/748/comments","events_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/748/events","html_url":"https://github.com/yajra/laravel-datatables/issues/748","id":176571279,"number":748,"title":"How to modify the search query","user":{"login":"vkosachev","id":6143450,"avatar_url":"https://avatars.githubusercontent.com/u/6143450?v=3","gravatar_id":"","url":"https://api.github.com/users/vkosachev","html_url":"https://github.com/vkosachev","followers_url":"https://api.github.com/users/vkosachev/followers","following_url":"https://api.github.com/users/vkosachev/following{/other_user}","gists_url":"https://api.github.com/users/vkosachev/gists{/gist_id}","starred_url":"https://api.github.com/users/vkosachev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkosachev/subscriptions","organizations_url":"https://api.github.com/users/vkosachev/orgs","repos_url":"https://api.github.com/users/vkosachev/repos","events_url":"https://api.github.com/users/vkosachev/events{/privacy}","received_events_url":"https://api.github.com/users/vkosachev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-13T07:37:13Z","updated_at":"2016-09-13T07:37:13Z","closed_at":null,"body":"### Summary of problem or feature request\r\nWhen serverSide processing is on, the global search is also sending a request to server for searching. The problem happens when I have in table virtual columns that do not exist on table.\r\n\r\nSo the question can be one of the following:\r\n1) How to modify the search query in this case?\r\n2) How to set search to be looking on client side, while pagination and etc - to remain server side.\r\n\r\nhttp://screencloud.net/v/y5zX - this shows the error.\r\n\r\n### Code snippet of problem\r\n\r\n**THE MODEL**\r\n```php\r\nclass Coupon extends BaseModel\r\n{\r\n\r\n    const TYPE_REWARD  = 1;\r\n    const TYPE_ONBOARD = 2;\r\n\r\n\r\n    public $appends = ['display_type'];\r\n\r\n    public function getDisplayTypeAttribute()\r\n    {\r\n        return (int)$this->type === self::TYPE_REWARD ? 'Rewards' : 'Onboarding';\r\n    }\r\n```\r\n**DATATABLE FILE**\r\n```php\r\nclass CouponDataTable extends BaseDataTable\r\n{\r\n    protected function getColumns()\r\n    {\r\n        return [\r\n            'id',\r\n            'code' => [\r\n                'title' => 'Code'\r\n            ],\r\n            'price',\r\n            'display_type' => [\r\n                'title' => 'Type'\r\n            ],\r\n            'used'=> [\r\n                'title' => 'Used/Unused'\r\n            ],\r\n            'status',\r\n            'created_at',\r\n            'expiry_date',\r\n            'actions' => [\r\n                'sortable' => false,\r\n                'orderable' => false,\r\n                'className' => 'col-xs-1'\r\n            ]\r\n        ];\r\n    }\r\n\r\n    public function ajax()\r\n    {\r\n      return $this->datatables->eloquent($this->query())->make(true);\r\n    }\r\n\r\n    public function query()\r\n    {\r\n        $query = $this->repository->getQB();  //get the query builder \r\n        return $this->applyScopes($query);\r\n    }\r\n}\r\n```\r\n\r\n\r\n\r\n\r\n-->\r\n\r\n### System details\r\n\r\n- Operating System - Ubuntu 14.04\r\n- PHP Version - PHP 7.0\r\n- Laravel Version - 5.2.45\r\n- Laravel-Datatables Version 6.18.1\r\n"}}
{"actor":{"display_login":"vkosachev"}}