{"action":"opened","issue":{"url":"https://api.github.com/repos/jarektkaczyk/eloquence/issues/98","repository_url":"https://api.github.com/repos/jarektkaczyk/eloquence","labels_url":"https://api.github.com/repos/jarektkaczyk/eloquence/issues/98/labels{/name}","comments_url":"https://api.github.com/repos/jarektkaczyk/eloquence/issues/98/comments","events_url":"https://api.github.com/repos/jarektkaczyk/eloquence/issues/98/events","html_url":"https://github.com/jarektkaczyk/eloquence/issues/98","id":162890275,"number":98,"title":"Problem searching in two related models","user":{"login":"ncarreno","id":7862823,"avatar_url":"https://avatars.githubusercontent.com/u/7862823?v=3","gravatar_id":"","url":"https://api.github.com/users/ncarreno","html_url":"https://github.com/ncarreno","followers_url":"https://api.github.com/users/ncarreno/followers","following_url":"https://api.github.com/users/ncarreno/following{/other_user}","gists_url":"https://api.github.com/users/ncarreno/gists{/gist_id}","starred_url":"https://api.github.com/users/ncarreno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncarreno/subscriptions","organizations_url":"https://api.github.com/users/ncarreno/orgs","repos_url":"https://api.github.com/users/ncarreno/repos","events_url":"https://api.github.com/users/ncarreno/events{/privacy}","received_events_url":"https://api.github.com/users/ncarreno/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-06-29T10:18:08Z","updated_at":"2016-06-29T10:18:08Z","closed_at":null,"body":"I have a products in my ecommerce and each product has its own translation in each language I am using. So I have a Product model where I store the general product data and a ProducLang Model where I store the translations of each language.\r\n\r\nI have a single search form in my website to find products. I want to look for information in reference colum that is in my products table (Product model) and in name and description that are in my products_lang table (ProductLang model).\r\n\r\nThis code doesn't work:\r\n`$result=Product::search(['*' . $request->input('search') . '*'], ['reference','lang.name','lang.description'])->get();`\r\n\r\nHowever this code woks:\r\n`$result=Product::search(['*' . $request->input('search') . '*'], ['lang.name','lang.description'])->get();`\r\n\r\nAnd this one also works:\r\n`$result=Product::search(['*' . $request->input('search') . '*'], ['reference'])->get();`\r\n\r\nMy Product model code is:\r\n\r\n```\r\n//Product Model\r\n...\r\nuse Sofa\\Eloquence\\Eloquence;\r\n\r\nclass Product extends Model\r\n{\r\n    use Eloquence;\r\n    //I have tried putting only reference, putting nothing and putting reference, lang.name, lang.description into the $searchableColumns but none of these work\r\n    protected $searchableColumns = ['reference'];\r\n...\r\n    public function lang()\r\n    {\r\n        return $this->hasMany('App\\ProductLang');\r\n    }\r\n```\r\nWhat am I doing wrong? Thanks for your help"}}
{"actor":{"display_login":"ncarreno"}}