Hi all. I've just started using Laravel ( v12 ) and it seems great.
I try to recreate an app i have done 15 years ago but with laravel.
Since laravel is a MVC framework, i've created my models, my migration files, my controllers and my views and it was pretty easy but i come up with a problem :
There is a page on the admin dashboard which allow to add or remove columns from a database table.
This is to allow the admin to add/remove some fields on a form and on the display listing page linked without the need to edit the php code and the db manually.
On the previous version of the app, i had created a text field in database which contains a json and i stored the datas there so it was dynamic. I could do this with an other DB than MySQL but it would mean migrate so much data from a base type to an other and it seems really long.
So i thought i could keep this solution but my problem is that with MVC approach, i would need to modify the model too ( the app is really old and i didn't know about MVC at this time so the queries are in the php file called by the request, without model or controller ).
I'm thinking about creating a model with a property which take the JSON value and explode it in the controller into an array from which i'll build the dynamic form and view but i think i'll loose the interest of having a model.
The other option that is see would be to create a script which modify the model and the controller files to add/remove the field and so having a model up to date even after a modification from the dashboard.
Is anybody has done something like this ? And if yes, have you a better way of doing this ?