I have a database table with the following structure.
| id | setting_name | setting_value |
|---|---|---|
| 1 | website_name | New Website |
| 2 | contact_email | [email protected] |
| 3 | contact_address | London, UK |
Now I am using laravel to return the values of this table,
$syetem_settings = System::all()
This returns it as a collection and there is no way I can use the individual values
$syetem_settings = System::all()->toArray()
This also returns it as an array and foreach loop isn't helping me.
What I want to do I want to use this variables in the view blade. e.g
{{system_settings->website_name}} // to return website name;
{{system_settings->contact_email}} // to return website email;
Please what is the right code for this? I'm using php 8 and laravel 9