tomshaw / laravel-database-export
A Laravel database export console command.
Installs: 496
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 3
pkg:composer/tomshaw/laravel-database-export
Requires
- php: ^8.3|^8.4|^8.5
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.20
- orchestra/testbench: ^10.0
- pestphp/pest: ^3.0
- phpstan/phpstan: ^2.0
This package is auto-updated.
Last update: 2026-02-23 03:05:25 UTC
README
A Laravel database export console command. Supports MySQL, PostgreSQL and SQL Server.
Requirements
- PHP 8.3, 8.4, or 8.5
- Laravel 12
Installation
You can install the package via composer:
composer require tomshaw/laravel-database-export
Usage
You can use the command like this:
php artisan db:export
You can also provide a password for the zip file:
php artisan db:export --password=yourpassword
Configuration
The command uses the following configuration keys:
database-export.disks.backup_filename: The base filename for the backup.database-export.disks.backup_directory: The directory where the backup files will be stored.
Description
The Database Export command does the following:
- Checks if the
ZipArchiveclass is available. - Retrieves the database connection details from the environment variables.
- Builds the command to export the database based on the database connection.
- Executes the command and saves the output to a file.
- Creates a zip file and adds the output file to it.
- Deletes the output file.
- Prints a success message.
Support
If you have any issues or questions, please open an issue on the GitHub repository.
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). See License File for more information.