{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/11493","labels_url":"https://api.github.com/repos/laravel/framework/issues/11493/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/11493/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/11493/events","html_url":"https://github.com/laravel/framework/issues/11493","id":123704189,"number":11493,"title":"[5.1] Eloquent with sqlsrv connection can't use Table-valued Functions as Table","user":{"login":"Murtnowski","id":1268178,"avatar_url":"https://avatars.githubusercontent.com/u/1268178?v=3","gravatar_id":"","url":"https://api.github.com/users/Murtnowski","html_url":"https://github.com/Murtnowski","followers_url":"https://api.github.com/users/Murtnowski/followers","following_url":"https://api.github.com/users/Murtnowski/following{/other_user}","gists_url":"https://api.github.com/users/Murtnowski/gists{/gist_id}","starred_url":"https://api.github.com/users/Murtnowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Murtnowski/subscriptions","organizations_url":"https://api.github.com/users/Murtnowski/orgs","repos_url":"https://api.github.com/users/Murtnowski/repos","events_url":"https://api.github.com/users/Murtnowski/events{/privacy}","received_events_url":"https://api.github.com/users/Murtnowski/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/laravel/framework/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/laravel/framework/labels/database","name":"database","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-23T18:28:15Z","updated_at":"2015-12-28T15:52:32Z","closed_at":null,"body":"When creating a model that extends Eloquent and has a connection using the sqlsrv driver, if you set the table property to be a MSSQL table-value function it can't run any queries because it wraps the function in square brackets and crahes with \"SQLSTATE[HY000]: General error: 208 General SQL Server error: Check messages from the SQL Server\"\r\n\r\nMeaning if set the table property to \r\n\r\nmyTableValueFunction()\r\n\r\nthe query that runs later uses\r\n\r\n...from [myTableValueFunction()]\r\n\r\nIf the query was instead \r\n\r\n...from \\[myTableValueFunction]()\r\n\r\nthen it would work.  Even\r\n\r\n...from myTableValueFunction()\r\n\r\nwould work."},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/167592149","html_url":"https://github.com/laravel/framework/issues/11493#issuecomment-167592149","issue_url":"https://api.github.com/repos/laravel/framework/issues/11493","id":167592149,"user":{"login":"Murtnowski","id":1268178,"avatar_url":"https://avatars.githubusercontent.com/u/1268178?v=3","gravatar_id":"","url":"https://api.github.com/users/Murtnowski","html_url":"https://github.com/Murtnowski","followers_url":"https://api.github.com/users/Murtnowski/followers","following_url":"https://api.github.com/users/Murtnowski/following{/other_user}","gists_url":"https://api.github.com/users/Murtnowski/gists{/gist_id}","starred_url":"https://api.github.com/users/Murtnowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Murtnowski/subscriptions","organizations_url":"https://api.github.com/users/Murtnowski/orgs","repos_url":"https://api.github.com/users/Murtnowski/repos","events_url":"https://api.github.com/users/Murtnowski/events{/privacy}","received_events_url":"https://api.github.com/users/Murtnowski/received_events","type":"User","site_admin":false},"created_at":"2015-12-28T15:52:32Z","updated_at":"2015-12-28T15:52:32Z","body":"@rodrigopedra Right now I'm just trying to use it in a Eloquent model\r\n\r\nSee this to understand what the model looks like http://pastebin.com/nxY37Zz5\r\n\r\nSo i'm not directly using the DB functions nor do I need to pass anything into the table-value function."}}