salvatorecervone/backup-database
A Laravel package for backing up your database with ease. salvatorecervone/backup-database provides simple commands and configuration to create, store, and manage database backups, helping you protect application data with minimal setup.
Install with Composer and confirm the service provider is auto-discovered; publish the package config if the README instructs it. Start by reviewing the package’s filesystem driver config and the smb disk example, then add a disk in config/filesystems.php:
'smb' => [
'driver' => 'smb',
'host' => env('SMB_HOST'),
'share' => env('SMB_SHARE'),
'username' => env('SMB_USERNAME'),
'password' => env('SMB_PASSWORD'),
'domain' => env('SMB_DOMAIN'),
'root' => env('SMB_ROOT', ''),
],
First use case: use it like any Laravel disk.
Storage::disk('smb')->put('reports/q1.pdf', $pdfContents);
Storage::disk('smb')->exists('reports/q1.pdf');
For 2.0.7 specifically, verify paths that were previously written as UNC paths such as \\server\share\folder\file.txt. Prefer configuring host/share/root and using relative paths like folder/file.txt.
Storage::disk('smb') or resolve FilesystemManager rather than using the adapter directly.readStream, writeStream, and putFileAs avoid loading entire files into memory..env and environment-specific config. Run php artisan config:clear after changing SMB settings, especially in cached deployments.Storage::fake('smb')) or bind a test double around the filesystem manager if the adapter cannot be faked directly.How can I help you explore Laravel packages today?