mahmoud-mhamed/laravel-backup-browse 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mahmoud-mhamed/laravel-backup-browse

最新稳定版本:v1.0.4

Composer 安装命令:

composer require mahmoud-mhamed/laravel-backup-browse

包简介

A web UI for managing Laravel backups and backup schedules, built on top of spatie/laravel-backup.

README 文档

README

A web UI for managing Laravel backups and backup schedules, built on top of spatie/laravel-backup.

PHP Laravel License

Features

  • Backup Management — View, create, download, and delete backups from a clean web interface
  • Scheduled Backups — Create and manage backup schedules (daily, weekly, monthly)
  • One-Click Backups — Run full, database-only, or files-only backups instantly
  • Queue Support — Backup jobs are dispatched to your queue for non-blocking execution
  • Polymorphic Tracking — Every backup records who created it
  • Custom Layout Support — Use the built-in Tailwind layout or plug into your own
  • Publishable Assets — Config, migrations, and views are all publishable

Installation

composer require mahmoud-mhamed/laravel-backup-browse

The package auto-discovers its service provider. No manual registration needed.

Publish Config (optional)

php artisan vendor:publish --tag=backup-browse-config

Run Migrations

php artisan migrate

Migrations are idempotent — running them twice won't cause errors.

Set Up the Scheduler

Add this to your server's crontab if you haven't already:

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

The package automatically registers its backup-browse:run-scheduled command to run every minute via Laravel's scheduler.

Configuration

After publishing, edit config/backup-browse.php:

return [
    // Middleware applied to all routes
    'middleware' => ['web', 'auth'],

    // URL prefix: yourdomain.com/backup-browse
    'route_prefix' => 'backup-browse',

    // Filesystem disk for storing backups
    'disk' => 'local',

    // Set to your app layout (e.g. 'layouts.app') or null for standalone
    'layout' => null,

    // @yield() section name in your layout
    'content_section' => 'content',

    // Queue settings (null = app defaults)
    'queue_connection' => null,
    'queue' => null,

    // Toggle which backup types are available
    'allow_full_backup' => true,
    'allow_db_only_backup' => true,
    'allow_files_only_backup' => true,
];

Usage

Web Interface

Navigate to /backup-browse in your browser.

Backups tab — View all backups with status badges, download completed backups, or delete old ones. Hit Backup Now, DB Only, or Files Only to trigger a new backup.

Schedules tab — Create, edit, and delete backup schedules. Choose from daily, weekly, or monthly frequencies. Toggle schedules on/off without deleting them.

Artisan Commands

Run all due backup schedules manually:

php artisan backup-browse:run-scheduled

Using Your Own Layout

Set the layout config to your app's layout view:

'layout' => 'layouts.app',
'content_section' => 'content',

The package views will render inside your layout's @yield('content') section. When layout is null, a standalone layout with Tailwind CSS (via CDN) is used.

Publish Views for Customization

php artisan vendor:publish --tag=backup-browse-views

Views will be copied to resources/views/vendor/backup-browse/ where you can modify them freely.

How It Works

User clicks "Backup Now"
        │
        ▼
BackupController creates a Backup record (status: pending)
        │
        ▼
CreateBackupJob is dispatched to queue
        │
        ▼
Job runs `php artisan backup:run` (spatie/laravel-backup)
        │
        ▼
Job finds the newest .zip on disk, updates Backup record
        │
        ▼
Backup status → completed (with path + size)

For scheduled backups, the backup-browse:run-scheduled command runs every minute, checks which schedules are due via cron expressions, and dispatches CreateBackupJob for each.

Database Schema

backups

Column Type Description
id bigint Primary key
name string Backup name
path string (nullable) File path on disk
disk string Filesystem disk
size bigint Size in bytes
status string pending, in_progress, completed, failed
created_by_id bigint (nullable) Polymorphic creator ID
created_by_type string (nullable) Polymorphic creator type
error_message text (nullable) Error details if failed
created_at timestamp
updated_at timestamp

backup_schedules

Column Type Description
id bigint Primary key
name string Schedule name
frequency string daily, weekly, monthly
time string HH:MM format
day_of_week tinyint (nullable) 0 (Sun) – 6 (Sat)
day_of_month tinyint (nullable) 1 – 31
only_db boolean Database-only backup
only_files boolean Files-only backup
enabled boolean Whether schedule is active
last_run_at timestamp (nullable) Last execution time
created_at timestamp
updated_at timestamp

Testing

composer test

Or directly:

vendor/bin/phpunit

Tests use Orchestra Testbench with SQLite in-memory. No external services required.

Requirements

License

MIT License. See LICENSE for details.

mahmoud-mhamed/laravel-backup-browse 适用场景与选型建议

mahmoud-mhamed/laravel-backup-browse 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 28 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 18 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「schedule」 「backup」 「laravel」 「browse」 「spatie」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 mahmoud-mhamed/laravel-backup-browse 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 mahmoud-mhamed/laravel-backup-browse 我们能提供哪些服务?
定制开发 / 二次开发

基于 mahmoud-mhamed/laravel-backup-browse 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 28
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 27
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-18