]> BookStack Code Mirror - bookstack/blobdiff - app/Entities/Controllers/RecycleBinController.php
respective book and chapter structure added.
[bookstack] / app / Entities / Controllers / RecycleBinController.php
index 334e803dfcf4312f68d9e4027c07136609676752..d11dde4dd73b19d39bb756076ef4d2c511ba26c5 100644 (file)
@@ -7,11 +7,11 @@ use BookStack\Entities\Models\Deletion;
 use BookStack\Entities\Models\Entity;
 use BookStack\Entities\Repos\DeletionRepo;
 use BookStack\Entities\Tools\TrashCan;
-use BookStack\Http\Controllers\Controller;
+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]));