How to create site setting in laravel

I’m trying to create website settings in a Laravel app. To store the settings, I created a table with two columns: “key” and “value”.

My settings data can be of various types, including arrays, strings, booleans, and others. I thought I could use $casts to handle the different data types, but it’s not working as expected. For example, if I set the column to cast as an array, the data stored in that column should always be an array, but that’s not the case.

Can you help me figure out how to handle different data types for my website settings in Laravel?

Thank you.