shogy/laravel-log-downloader
最新稳定版本:v1.0.5
Composer 安装命令:
composer require shogy/laravel-log-downloader
包简介
Package that will easily grab all log files from your Laravel project.
README 文档
README
Laravel Log Downloader is a package that allows you to easily download all log files from your Laravel project as a ZIP archive. This package provides both web and API routes for flexibility.
Features
- Download all log files as a ZIP archive.
- Supports both web and API routes.
- Automatically deletes the ZIP file after download.
- Compatible with Laravel 11.x.
Installation
You can install the package via Composer:
composer require shogy/laravel-log-downloader
Configuration
After installing the package, the service provider will be automatically registered. If you need to register it manually, add the following line to your config/app.php file:
'providers' => [
// Other Service Providers
Shogy\LaravelLogDownloader\LogDownloaderServiceProvider::class,
],
Usage
Web route
To download logs via a web route, navigate to the following URL in your browser:
http://your-app-url/download-logs
Api route
To download logs via an API route, send a GET request to:
http://your-app-url/api/download-logs
Make sure to include the necessary API authentication if your API routes are protected.
Route middleware
By default, the web route uses the web and auth middleware, while the API route uses the api and auth:api middleware. You can customize the middleware as needed.
// Web route Route::middleware(['web', 'auth'])->get('/download-logs', [LogDownloadController::class, 'downloadLogs']); // Api route Route::middleware(['api', 'auth:api'])->get('/api/download-logs', [LogDownloadController::class, 'downloadLogs']);
Contributions
Contributions are welcome! If you encounter any issues or have questions, feel free to open an issue on GitHub.
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-22