tomshaw / laravel-database-export
A Laravel database export console command.
v0.1.0
2023-11-11 00:42 UTC
Requires
- php: ^8.1
Requires (Dev)
- laravel/pint: ^1.13
- nunomaduro/larastan: ^2.6
- orchestra/testbench: ^8.14
- phpstan/phpstan: ^1.10
This package is auto-updated.
Last update: 2025-03-03 03:21:44 UTC
README
A Laravel console command that allows you to export your database. It supports multiple database connections including MySQL, PostgreSQL, and SQL Server.
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
ZipArchive
class 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.
License
This package is open-source software licensed under the License for more information.