PHP code example of amdadulhaq / database-backup-laravel
1. Go to this page and download the library: Download amdadulhaq/database-backup-laravel 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/ */
amdadulhaq / database-backup-laravel example snippets
bash
# restore the most recent backup for the connection
php artisan db:restore --latest
# restore a specific file from the disk
php artisan db:restore backups/pgsql/pgsql-app-2026-09-01_020000.sql.gz
# skip the "this overwrites the database" prompt (for scripts)
php artisan db:restore --latest --force