1 <?php namespace BookStack\Http\Controllers;
3 use BookStack\Entities\Deletion;
4 use BookStack\Entities\Managers\TrashCan;
5 use Illuminate\Http\Request;
7 class RecycleBinController extends Controller
10 * Show the top-level listing for the recycle bin.
12 public function index()
14 $this->checkPermission('settings-manage');
15 $this->checkPermission('restrictions-manage-all');
17 $deletions = Deletion::query()->with(['deletable', 'deleter'])->paginate(10);
19 return view('settings.recycle-bin', [
20 'deletions' => $deletions,
25 * Empty out the recycle bin.
27 public function empty()
29 $this->checkPermission('settings-manage');
30 $this->checkPermission('restrictions-manage-all');
32 $deleteCount = (new TrashCan())->destroyFromAllDeletions();
34 $this->showSuccessNotification(trans('settings.recycle_bin_empty_notification', ['count' => $deleteCount]));
35 return redirect('/settings/recycle-bin');