File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -68,3 +68,15 @@ To export a remote database to OVERRIDE your local database by running:
6868``` bash
6969php artisan db:production-sync
7070```
71+
72+ Provide a filename for export on the fly by passing the option --filename, remember to provide .sql
73+
74+ ``` bash
75+ php artisan db:production-sync --filename=other.sql
76+ ```
77+
78+ Run the command without attempting to export:
79+
80+ ``` bash
81+ php artisan db:production-sync --test
82+ ```
Original file line number Diff line number Diff line change 77
88class DbSyncCommand extends Command
99{
10- protected $ signature = 'db:production-sync {--test} ' ;
10+ protected $ signature = 'db:production-sync {--test} {--filename=} ' ;
1111 protected $ description = 'Sync production database with local ' ;
1212
1313 public function handle (): bool
@@ -31,7 +31,7 @@ public function handle(): bool
3131 $ ignoreTables = explode (', ' , $ ignore );
3232 $ importSqlFile = config ('dbsync.importSqlFile ' );
3333 $ removeFileAfterImport = config ('dbsync.removeFileAfterImport ' );
34- $ fileName = $ this ->argument ('filename ' ) ?? config ('dbsync.defaultFileName ' );
34+ $ fileName = $ this ->option ('filename ' ) ?? config ('dbsync.defaultFileName ' );
3535
3636 if (empty ($ host ) || empty ($ username ) || empty ($ database )) {
3737 $ this ->error ("DB credentials not set, have you published the config and set ENV variables? " );
You can’t perform that action at this time.
0 commit comments