if the lines have a specific format :
- line-content always has a background and a content field
- line-media has both + title / position / imageSrc / link / plus etc.
You could still put this in the DB:
- LineModel -> morphsTo -> LineContentModel & LineMediaModel which have their own set of fields.
Even if the fields dont have a specific format, you could use a Line model, with a json field, where you simply save the object in json format into that single field.
If you really want to go into the route of filesystem, I would take the model where these 'Lines' relate to, and put 2 methods in it, 1 to write it's lines to a bunch of files (or a single file, depending on the usecase) and 1 method to get all of its related lines.
To give a better answer I would definately need more info about the data you are trying to gather / manipulate / respond to the user and it's internal relations.