Reputation: 17
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: [email protected] password: 123456) Does any one know how can i do something like this?
Upvotes: 1
Views: 710
Reputation: 6272
Yes, you can add interface for spatie/laravel-backup
package using another package which also uses this spatie package and provides beautiful user interface to interact with it, the package is : https://github.com/pavel-mironchik/laravel-backup-panel
Using composer you can install it by below command:
composer require pavel-mironchik/laravel-backup-panel
After installing, publish its resources using below Artisan command:
php artisan laravel-backup-panel:install
Then just goto http://{your-project}/backup
and the interface will appear in your project you can customize it from resources/views/vendor/laravel_backup_panel
directory.
The package provides UI for creating backups with options like full backup, only db or only files backup and also provides functions for downloading and deleting the backup and listing all the existing backups.
It will look like below screen:
I like it very much, isn't it just elegant?!!!
Upvotes: 0
Reputation: 91
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
}
Upvotes: 1