title: Laravel model field with dynamic type
body: <p>In my Laravel project, I'm building a way to dynamically create questions which the users of my platform should answer. For this I have two models:</p>
  
  <p>One model for the questions, containing one field (string) for the question itself and one field for what type of question it is (free text, dropdown, checkbox etc).</p>
  
  <p>And then I have one model for the answers given by the users. My question is in what format I am to use for the answers, since it's different type depending on the question. My initial plan is to make it a string, and then if it's a checkbox (boolean) question I have to store it as "true" or "false", if it's a dropdown I store the index of the answer as "1", "2" etc. This would work but it doesn't feel like an elegant solution. Are there better ways to do this? What i'd really want would be some kind of field with dynamic type...</p>