{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/13926","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/13926/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/13926/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/13926/events","html_url":"https://github.com/laravel/framework/issues/13926","id":159399167,"number":13926,"title":"Eloquent: Serialization error","user":{"login":"AidasK","id":2088484,"avatar_url":"https://avatars.githubusercontent.com/u/2088484?v=3","gravatar_id":"","url":"https://api.github.com/users/AidasK","html_url":"https://github.com/AidasK","followers_url":"https://api.github.com/users/AidasK/followers","following_url":"https://api.github.com/users/AidasK/following{/other_user}","gists_url":"https://api.github.com/users/AidasK/gists{/gist_id}","starred_url":"https://api.github.com/users/AidasK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AidasK/subscriptions","organizations_url":"https://api.github.com/users/AidasK/orgs","repos_url":"https://api.github.com/users/AidasK/repos","events_url":"https://api.github.com/users/AidasK/events{/privacy}","received_events_url":"https://api.github.com/users/AidasK/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":3,"created_at":"2016-06-09T12:47:19Z","updated_at":"2016-06-17T14:19:49Z","closed_at":null,"body":"Hi, \r\nI have encountered a weird error. In eloquent model, appended attribute is used instead of the table name then creating a query. But this happens only in production server(maybe mysql version is different).\r\n\r\nI am receiving an error:\r\n```\r\nIlluminate\\Database\\QueryException\r\n\r\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'quiz.quiz_url' doesn't exist (SQL: select * from `quiz_url` where `quiz_url`.`quiz_id` = 1 and `quiz_url`.`quiz_id` is not null and `language` = en limit 1)\r\n```\r\n\r\nMy model is\r\n```php\r\nclass QuizLanguage extends Model\r\n{\r\n    protected $table = 'quiz_language';\r\n\r\n    protected $guarded = [];\r\n\r\n    protected $appends = [\r\n        'quiz_url',\r\n        'edit_url',\r\n    ];\r\n\r\n    public function quiz()\r\n    {\r\n        return $this->belongsTo('App\\Models\\Quiz');\r\n    }\r\n\r\n    public function getEditUrlAttribute()\r\n    {\r\n        return action('QuizLanguageController@edit', [$this]);\r\n    }\r\n\r\n    public function getQuizUrlAttribute()\r\n    {\r\n        return action('QuizLanguageController@url', [$this]);\r\n    }\r\n}\r\n```\r\n```php\r\nclass Quiz extends Model\r\n{\r\n    protected $table = 'quiz';\r\n    public function languages()\r\n    {\r\n        return $this->hasMany('App\\Models\\QuizLanguage');\r\n    }\r\n}\r\n```\r\nError occurs then I call this:\r\n```php\r\n$quizLanguage = \\Cache::remember('quiz-language', 60, function () {\r\n             return QuizLanguage::with('quiz')->where('id', '=',55)->whereActive(1)->first();\r\n });\r\n$model = $quizLanguage->quiz->languages()->whereLanguage('en')->first();//Throws an error mentioned above\r\n```\r\n\r\nServer specs:\r\nLaravel v5.2.35\r\nPHP 7.0.6\r\nMysql: Google Cloud SQL 2nd gen.\r\nmemcached 1.4.25\r\n\r\nAny help is appreciated, thanks. "},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/226781496","html_url":"https://github.com/laravel/framework/issues/13926#issuecomment-226781496","issue_url":"https://api.github.com/repos/laravel/framework/issues/13926","id":226781496,"user":{"login":"GrahamCampbell","id":2829600,"avatar_url":"https://avatars.githubusercontent.com/u/2829600?v=3","gravatar_id":"","url":"https://api.github.com/users/GrahamCampbell","html_url":"https://github.com/GrahamCampbell","followers_url":"https://api.github.com/users/GrahamCampbell/followers","following_url":"https://api.github.com/users/GrahamCampbell/following{/other_user}","gists_url":"https://api.github.com/users/GrahamCampbell/gists{/gist_id}","starred_url":"https://api.github.com/users/GrahamCampbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrahamCampbell/subscriptions","organizations_url":"https://api.github.com/users/GrahamCampbell/orgs","repos_url":"https://api.github.com/users/GrahamCampbell/repos","events_url":"https://api.github.com/users/GrahamCampbell/events{/privacy}","received_events_url":"https://api.github.com/users/GrahamCampbell/received_events","type":"User","site_admin":false},"created_at":"2016-06-17T14:19:49Z","updated_at":"2016-06-17T14:19:49Z","body":"Thanks for the report. Please can you provide the exact Laravel version you are using?"}}
{"actor":{"display_login":"GrahamCampbell"}}