Export database (only data) with Laravel 4

ⅰ亾dé卋堺 提交于 2019-12-08 04:55:25

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!