问题
I'm trying to find a package or method which allow me to export all the data from my database (SQL) in order to backup the database.
The goal is to have a button to save the database in a SQL file and download it, so i need a method in a controller to export the data.
I found nothing on http://packalyst.com/packages
Is somebody knows a way to do that ?
Thanks
回答1:
You can use this package - which is an excellent backup manager:
https://github.com/heybigname/backup-manager
If you want it to be accessible via a controller - you can just call the artisan command from your controller:
function someControllerFunction()
{
Artisan::call('db:backup');
}
来源:https://stackoverflow.com/questions/26411299/export-database-only-data-with-laravel-4