yousefpackage/lara-backup
最新稳定版本:v1
Composer 安装命令:
composer require yousefpackage/lara-backup
包简介
This is a Laravel package for backing up databases
README 文档
README
composer require yousefpackage/lara-backup
then goto config folder
in config/app.php
'providers' => [
Yousefpackage\LaraBackup\Providers\LaraBackupServiceProvider::class,
Yousefpackage\LaraBackup\Providers\BackupServiceProvider::class,
Yousefpackage\LaraBackup\Providers\RouteServiceProvider::class,
],
then goto kernel.php
write this in $routeMiddleware
'DbBackup'=>\Yousefpackage\LaraBackup\Middleware\DbAlertMiddleware::class,
then goto env file and put this
BACKUP_DB_HOST=127.0.0.1
BACKUP_DB_PORT=3306
BACKUP_DB=backup
BACKUP_DB_USERNAME=root
BACKUP_DB_PASSWORD=
then run this command after create your database
php artisan db:alert
using
Now Put this middleware on the routes.
->middleware('DbBackup');
like this
Route::get('/data', function () {
return response()->json('data');
})->middleware('DbBackup');
get database alerts
now to get database backup database alerts using this api
http://127.0.0.1:8000/api/dbAlerts
统计信息
- 总下载量: 255
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-17