src/Tasks/Backup/BackupJob.php
protected function dumpDatabases(): array
    {
        return $this->dbDumpers->map(function (DbDumper $dbDumper, $key) {
            consoleOutput()->info("Dumping database {$dbDumper->getDbName()}...");

            $dbType = mb_strtolower(basename(str_replace('\\', '/', get_class($dbDumper))));

            $dbName = $dbDumper->getDbName();
            if ($dbDumper instanceof Sqlite) {
                $dbName = $key.'-database';
            }

            $fileName = "{$dbType}-{$dbName}.{$this->getExtension($dbDumper)}";

            if (config('backup.backup.gzip_database_dump')) {
                $dbDumper->useCompressor(new GzipCompressor());
                $fileName .= '.'.$dbDumper->getCompressorExtension();
            }

            if ($compressor = config('backup.backup.database_dump_compressor')) {
                $dbDumper->useCompressor(new $compressor());
                $fileName .= '.'.$dbDumper->getCompressorExtension();
            }

            $temporaryFilePath = $this->temporaryDirectory->path('db-dumps'.DIRECTORY_SEPARATOR.$fileName);

            $dbDumper->dumpToFile($temporaryFilePath);

            return $temporaryFilePath;
        })->toArray();
    }
protected function dumpDatabases(): array
    {
        return $this->dbDumpers->map(function (DbDumper $dbDumper, $key) {
            consoleOutput()->info("Dumping database {$dbDumper->getDbName()}...");

            $dbType = mb_strtolower(basename(str_replace('\\', '/', get_class($dbDumper))));

            $dbName = $dbDumper->getDbName();
            if ($dbDumper instanceof Sqlite) {
                $dbName = $key.'-database';
            }

            $fileName = "{$dbType}-{$dbName}.{$this->getExtension($dbDumper)}";

            if (config('backup.backup.gzip_database_dump')) {
                $dbDumper->useCompressor(new GzipCompressor());
                $fileName .= '.'.$dbDumper->getCompressorExtension();
            }

            if ($compressor = config('backup.backup.database_dump_compressor')) {
                $dbDumper->useCompressor(new $compressor());
                $fileName .= '.'.$dbDumper->getCompressorExtension();
            }

            $temporaryFilePath = $this->temporaryDirectory->path('db-dumps'.DIRECTORY_SEPARATOR.$fileName);

            $dbDumper->dumpToFile($temporaryFilePath);

            return $temporaryFilePath;
        })->toArray();
    }
protected function dumpDatabases ( ) : array { return $ this -> dbDumpers -> map ( function ( DbDumper $ dbDumper , $ key ) { consoleOutput ( ) -> info ( "Dumping database {$dbDumper->getDbName()}..." ) ; $ dbType = mb_strtolower ( basename ( str_replace ( '\\' , '/' , get_class ( $ dbDumper ) ) ) ) ; $ dbName = $ dbDumper -> getDbName ( ) ; if ( $ dbDumper instanceof Sqlite ) { $ dbName = $ key . '-database' ; } $ fileName = "{$dbType}-{$dbName}.{$this->getExtension($dbDumper)}" ; if ( config ( 'backup.backup.gzip_database_dump' ) ) { $ dbDumper -> useCompressor ( new GzipCompressor ( ) ) ; $ fileName .= '.' . $ dbDumper -> getCompressorExtension ( ) ; } if ( $ compressor = config ( 'backup.backup.database_dump_compressor' ) ) { $ dbDumper -> useCompressor ( new $ compressor ( ) ) ; $ fileName .= '.' . $ dbDumper -> getCompressorExtension ( ) ; } $ temporaryFilePath = $ this -> temporaryDirectory -> path ( 'db-dumps' . DIRECTORY_SEPARATOR . $ fileName ) ; $ dbDumper -> dumpToFile ( $ temporaryFilePath ) ; return $ temporaryFilePath ; } ) -> toArray ( ) ; }
Dumps the databases to the given directory.
Returns an array with paths to the dump files.

@return array
Dumps the databases to the given directory . Returns an array with paths to the dump files .