Skip to content

How can i storage the file in a specific folder? #176

Answered by CesarObedFL
CesarObedFL asked this question in Q&A
Discussion options

You must be logged in to vote

if anyone need this we can use the php function 'rename( $filename, 'storage/app/public/database_backups/'.$filename );' and place the file in a public folder and from there downloading it

in your laravel command class

    public function handle()
    {
        $today_date = new \DateTime("now", new \DateTimeZone('America/Mexico_City'));
        $filename = "db_backup_".$today_date->format('Y-m-d').".sql";

        MySql::create()
                ->setDumpBinaryPath( env('DUMP_BINARY_PATH') )
                ->setDbName( env('DB_DATABASE') )
                ->setUserName( env('DB_USERNAME') )
                ->setPassword( env('DB_PASSWORD') )
                ->setHost( env('DB_HOST') )
 …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by CesarObedFL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant