Code of the question: http://stackoverflow.com/questions/16656805/laravel-4-eloquent-one-to-many-relations-error