Mahdi Jafari
Mahdi Jafari

Reputation: 415

How to implement dashboard settings in Laravel project

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

  1. Is there any better way to implement this?
  2. If it is correct, how to handle the problems I mentioned?

Upvotes: 0

Views: 396

Answers (1)

Jibin Bose
Jibin Bose

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

Related Questions