- // Sanitize $color if "#" is provided
- if($color[0] == '#' ) {
- $color = substr($color, 1);
+ // Get application version
+ $version = trim(file_get_contents(base_path('version')));
+
+ return view('settings.maintenance', ['version' => $version]);
+ }
+
+ /**
+ * Action to clean-up images in the system.
+ */
+ public function cleanupImages(Request $request, ImageService $imageService)
+ {
+ $this->checkPermission('settings-manage');
+
+ $checkRevisions = !($request->get('ignore_revisions', 'false') === 'true');
+ $dryRun = !($request->has('confirm'));
+
+ $imagesToDelete = $imageService->deleteUnusedImages($checkRevisions, $dryRun);
+ $deleteCount = count($imagesToDelete);
+ if ($deleteCount === 0) {
+ $this->showWarningNotification(trans('settings.maint_image_cleanup_nothing_found'));
+ return redirect('/settings/maintenance')->withInput();