使用Laravel 4导出数据库(仅数据) [英] Export database (only data) with Laravel 4
问题描述
我正在尝试找到一个包或方法,该包或方法允许我从数据库(SQL)导出所有数据以备份数据库.
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.
目标是要有一个按钮来将数据库保存到SQL文件中并下载,因此我需要控制器中的一种方法来导出数据.
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.
我在 http://packalyst.com/packages
有人知道这样做的方法吗?
Is somebody knows a way to do that ?
谢谢
推荐答案
您可以使用此软件包-这是一个出色的备份管理器:
You can use this package - which is an excellent backup manager:
https://github.com/heybigname/backup-manager
如果您希望可以通过控制器访问它-您可以从控制器中调用artisan命令:
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');
}
这篇关于使用Laravel 4导出数据库(仅数据)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!