added get_settings_in_json helper

This commit is contained in:
Peter Papp
2021-03-12 14:35:12 +01:00
parent af5181d4d7
commit 8ef5444136
2 changed files with 16 additions and 8 deletions
+12
View File
@@ -38,6 +38,18 @@ function get_setting($setting)
return Setting::find($setting)->value ?? null;
}
/**
* Get all app settings and return them as json
*/
function get_settings_in_json()
{
return json_decode(
Setting::all()
->pluck('value', 'name')
->toJson()
);
}
/**
* Create paragraph from text
*