SalmanPatnee's avatar

How to implement theme options in Laravel Website?

I want to implement theme options module in my website which is obviously powered by Laravel. I'm wondering where to store options like: Social icons address, Google map code for contact page, Copyright text.. Like we have in WordPress. What is the best practice ?

0 likes
5 replies
tisuchi's avatar

If you need to cover you mentioned parts, just simply create pages in your admin page. Store all data in database, and display in your page.

For example- Social Icon. In your admin, create a page where you show drop down / input field for social icons.

3 likes
SalmanPatnee's avatar

Means if i have 30 options then i'll need 30 columns in database table most probably options table ?

tisuchi's avatar

Depends on, how do you want to design.

May be can follow this idea-

socialicons: {
    "facebook" : "fa facebook-icon",
    "twitter" : "fa twitter-icon",
    "linkedin" : "fa linkedin-icon",
}

In your tables, just insert into one column. Such a way, you can add as much as you want.

4 likes
tisuchi's avatar

I believe, wordpress is also doing that.

4 likes

Please or to participate in this conversation.