]> BookStack Code Mirror - bookstack/blobdiff - app/Entities/Controllers/RecycleBinController.php
respective book and chapter structure added.
[bookstack] / app / Entities / Controllers / RecycleBinController.php
index 30b184bbe00c9356cffe5707606faf0d127e9ecb..d11dde4dd73b19d39bb756076ef4d2c511ba26c5 100644 (file)
@@ -11,7 +11,7 @@ use BookStack\Http\Controller;
 
 class RecycleBinController extends Controller
 {
-    protected $recycleBinBaseUrl = '/settings/recycle-bin';
+    protected string $recycleBinBaseUrl = '/settings/recycle-bin';
 
     /**
      * On each request to a method of this controller check permissions
@@ -116,9 +116,9 @@ class RecycleBinController extends Controller
      *
      * @throws \Exception
      */
-    public function empty()
+    public function empty(TrashCan $trash)
     {
-        $deleteCount = (new TrashCan())->empty();
+        $deleteCount = $trash->empty();
 
         $this->logActivity(ActivityType::RECYCLE_BIN_EMPTY);
         $this->showSuccessNotification(trans('settings.recycle_bin_destroy_notification', ['count' => $deleteCount]));