added it_update_settings, it_get_page, it_update_settings_image test

This commit is contained in:
Peter Papp
2021-03-05 11:57:48 +01:00
parent e514994b08
commit ce08240355
10 changed files with 250 additions and 194 deletions
+4 -6
View File
@@ -35,9 +35,7 @@ function obfuscate_email($email)
*/
function get_setting($setting)
{
$row = Setting::where('name', $setting)->first();
return $row ? $row->value : null;
return Setting::find($setting)->value ?? null;
}
/**
@@ -256,13 +254,13 @@ function store_avatar($image)
function store_system_image($image)
{
// Store avatar
$image_path = Str::random(8) . '-' . str_replace(' ', '', $image->getClientOriginalName());
$filename = Str::random(8) . '-' . str_replace(' ', '', $image->getClientOriginalName());
// Store image to disk
Storage::putFileAs('system', $image, $image_path);
Storage::putFileAs('system', $image, $filename);
// Return path to image
return `system/$image_path`;
return "system/$filename";
}
/**