I am trying to create an application that would store lots of meta data for a user and the same meta key can be stored more than once. Code given in the old forum at http://forumsarchive.laravel.io/viewtopic.php?id=12052 looks more suitable to my need but then I did not understand the purpose of 'metable_type' field? I wonder if it would store the data type like int, string etc or something else?
The metable_type field is used with polymorphic relations, where the Eloquent class name is stored along with the key.
Check out http://laravel.com/docs/eloquent#polymorphic-relations for more.
This enables the link back from the meta table to the linked object, which could be different objects, say Post or Comment, or Category.
Thanks @allmyitjason, that seems a great help. I would like to ask whether the above approach should be used in my case - where I would have artists as user and artists can have bio, many audios, videos, images and other fields.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community