I am working on a site that will allow users to submit video, images, and another guides (multiple steps that include text and an image).
On the main page of the site, there will be a list of the last 5-10 items or so that were uploaded.
Originally, I was planning on having a table for each, so 'videos', 'images', and 'guides'. The 'guides' table would have another table 'steps' so each step would be it's own row with a 'guide_id'.
On the main page, each of these elements would required different code to render (iframe for videos, img tag for images, etc...).
Is there a better way to create the database for this? Maybe a content item table that has all the different content in it with a 'type' column?
If not, what would be the best way to write a query to select 5-10 pieces from all three tables and be able to tell what type of content each row of the result would be so it can be rendered with the proper code?
By the way, I am using Laravel PHP framework if that influences that answer.