namespace BookStack\Settings;
+use BookStack\Uploads\FaviconHandler;
use BookStack\Uploads\ImageRepo;
use Illuminate\Http\Request;
class AppSettingsStore
{
- protected ImageRepo $imageRepo;
-
- public function __construct(ImageRepo $imageRepo)
- {
- $this->imageRepo = $imageRepo;
+ public function __construct(
+ protected ImageRepo $imageRepo,
+ protected FaviconHandler $faviconHandler,
+ ) {
}
public function storeFromUpdateRequest(Request $request, string $category)
$icon = $this->imageRepo->saveNew($iconFile, 'system', 0, $size, $size);
setting()->put('app-icon-' . $size, $icon->url);
}
+
+ $this->faviconHandler->saveForUploadedImage($iconFile);
}
// Clear icon image if requested
$this->destroyExistingSettingImage('app-icon-' . $size);
setting()->remove('app-icon-' . $size);
}
+
+ $this->faviconHandler->restoreOriginal();
}
}