Link custom articles blade file in the database
Hi!
I'm working (slowly) on a website for my students. The website will be divided in multiple parts:
-
One will be some (math) exercises and I will build them like a "blog", so using a form and a database. For this part, my concern would be to minimize my work between writing in latex and display the result in a website. But this is another question and not really part of laravel.
-
One other parts, and that's where I have my main question, is to create some pages with dynamic content, where the students can handle geometric figures, plot functions, ... The idea is to do a lot of little "articles" with these dynamic contents (one article per chapter / problem / theme / ...). So I cannot just create a form and paste some text and, once submitted, add it to the database, as it contains alpine.js function and much more...
I already started to make some articles / tools: they are blade files in a paticular folder (and subfolders). Actually, I have two categories:
Tools: I made a controller where I manually add the different possibilities. Not really funny :( Articles: I added at the top of the file a markup (json) data. Once I browse to a particular part of the webiste, laravel scans the folder and add to/update the database with the file header...
So... my question (finally!). Is there a better way to handle this: tell laravel to scan a folder (and subfolder) for blade files and automatically add them to a table in my database ? Or maybe I'm doing everything wrong and I shouldn't do make my files like this ?
Thanks for your help, Basil
PS: By the way, if you have any idea on how to install LaTeX on a website and the command to compile a file...
Please or to participate in this conversation.