Download the PHP package sukhrobnurali/laravel-db-backup without Composer
On this page you can find all versions of the php package sukhrobnurali/laravel-db-backup. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sukhrobnurali/laravel-db-backup
More information about sukhrobnurali/laravel-db-backup
Files in sukhrobnurali/laravel-db-backup
Package laravel-db-backup
Short Description A Laravel package for backing up MySQL and PostgreSQL databases with support for multiple storage drivers and scheduled backups.
License MIT
Informations about the package laravel-db-backup
Laravel Database Backup
Laravel Database Backup is a robust, extensible package for Laravel that simplifies backing up your MySQL and PostgreSQL databases. Built with clean, object-oriented principles, this package offers scheduled backups, multi-storage support, and automatic cleanup of old backups.
Features
- Scheduled Backups: Easily schedule backups daily, weekly, or monthly using Laravel's scheduler.
- Multi-Storage Support: Store backups locally—with the option to add remote storage drivers (e.g., S3, Google Drive) in the future.
- Automatic Cleanup: Automatically delete backups older than a specified retention period to save disk space.
- Artisan Command: Trigger backups manually using a simple Artisan command.
- Custom Exception Handling: Domain-specific error handling with custom exceptions.
- Extensible Architecture: Clean, modular design for easy integration and future enhancements.
Installation
Install the package via Composer:
Publish the configuration file:
Configuration
The configuration file (config/backup.php
) allows you to customize several aspects of the package:
- Local Storage: Specify the directory where backups will be stored.
- Remote Storage (Stub): Configure remote storage options for future expansion.
- Retention Policy: Set the number of days to retain backups.
- Scheduling: Use cron expressions to schedule your backups.
- Notifications (Stub): Configure notification options (e.g., via Telegram) for backup events.
Usage
To manually run a backup, simply execute the Artisan command:
To schedule automatic backups, add the command to your Laravel scheduler in app/Console/Kernel.php
:
Testing
This package includes a comprehensive test suite using Orchestra Testbench. To run the tests, execute:
Contributing
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Write tests and ensure that everything passes.
- Submit a pull request.
License
This package is open-sourced software licensed under the MIT license.