如何从用户界面 CRM 创建备份?

How to create backups from user interface CRM?

我正在尝试为我的 CRM 创建一个备份选项。我已经安装了这个包 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(电子邮件:admin@demosite.com 密码:123456)有人知道我该怎么做吗?

通过代码调用命令

在 CLI 之外执行 Artisan 命令。例如,您可能希望从路由或控制器触发 Artisan 命令。您可以使用 Artisan facade 上的 call 方法来完成此操作。在你的控制器上你可以这样做:

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

}