Reputation: 415
I want to implement admin panel settings(coloring, theme, font, logo...) in Laravel project.
I have used limitless bootstrap admin panel for my project, laravel blade, and no front end framework such as vue.js or anything else.
The solution that I know, is that make a settings table which save colors and other settings.
But the problem is putting those data into css file, frequently fetching those data ....
My Question
Upvotes: 0
Views: 396
Reputation: 589
To persist the data across devices or multiple sessions you would need to store them as database values. I will suggest you keep these values in a JSON data column in your SQL database mapped against a particular user id or so.
When a user logs in to the application check if he has a record for custom settings in the DB. If so, pull in that record (JSON data) and store it in the current session. Further in your HTML files use values from your session store to alter styling or logo or things you wish to change. This way you will limit DB query to the very first login request only.
An additional thing to note is you should update the session store values if in case the user updates these settings anything during his active session.
Note: Haven't implemented the same, just a wild guess that sounds ideal to me.
Upvotes: 1