PHP code example of webhubworks / laravel-backup-viewer
1. Go to this page and download the library: Download webhubworks/laravel-backup-viewer library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
webhubworks / laravel-backup-viewer example snippets
// app/Providers/AppServiceProvider.php
use Webhub\BackupViewer\BackupViewer;
public function boot(): void
{
BackupViewer::auth(function ($request) {
return $request->user()?->is_admin === true;
});
}
return [
'enabled' => true,
'route' => [
'path' => 'backups',
'name' => 'backup-viewer.index',
'domain' => null,
],
'middleware' => ['web'],
'download' => [
'max_bytes' => 500 * 1024 * 1024, // 500 MB cap; null to disable
],
'low_disk_space_threshold' => 0.15, // warn when < 15% free
'monitor_stale_after_minutes' => 1440, // 24h
'favicon' => [
'html' => null, // raw <link ...> block pasted from your main layout
'path' => null, // OR a single href like '/favicon.svg'
],
];