Introduction | laravel-backup | Spatie
Installation and setup | laravel-backup | Spatie
php artisan backup:run --only-db
This is only for local development.
backup of database on hosting cannot be done like this, depends on your hosting plan
composer require spatie/laravel-backup
Then to create configuration file (see docs);
php artisan vendor:publish --provider="Spatie\\Backup\\BackupServiceProvider" --tag=backup-config
Then add dump path to config/database.php;