简体   繁体   中英

How to create backups from user interface CRM?

i am trying to make a backup option for my CRM. I have install this package https://spatie.be/docs/laravel-backup/v5/taking-backups/overview and i am using laravel 6^. I can backup my db and all system configuration with this package if i run backup:run from Terminal but this is not all i want. What i am looking for is to crate an interface where admin of page can make backup manually by clicking on options. For example like this: https://jobclass.laraclassifier.com/admin/backups (email: admin@demosite.com password: 123456) Does any one know how can i do something like this?

Calling Commands Via Code

Executing an Artisan command outside of the CLI. For example, you may wish to fire an Artisan command from a route or controller. You may use the call method on the Artisan facade to accomplish this. The on your controller you can do this:

public function createBackup(){
 Artisan::call('backup:run',['--only-db'=>true]);
 /// whatever you want to display

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM