定制 filipefernandes/laravel-route-retry 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

filipefernandes/laravel-route-retry

Composer 安装命令:

composer require filipefernandes/laravel-route-retry

包简介

A Laravel package to capture and retry failing requests.

README 文档

README

Thumbnail

Laravel Route Retry adds a simple and flexible way to capture failed requests (5xx) and retry them later. It's perfect for handling transient failures in webhooks, external API calls, or any critical route.

Installation

You can install the package via composer:

composer require filipefernandes/laravel-route-retry

You can publish the config file with:

php artisan vendor:publish --tag="retry-config"

Then, run the migrations:

php artisan migrate

Usage

Simple Route Retry

You can enable retries on any route using the retry() macro:

use Illuminate\Support\Facades\Route;

Route::post('/webhooks/stripe', function () {
    // If this fails with 5xx, it will be captured
})->retry(3); // Retry up to 3 times

Adding Tags

Tags help you filter and process retries for specific features:

Route::post('/sync-data', [SyncController::class, 'handle'])
    ->retry(5)
    ->tags(['erp', 'priority-high']);

Processing Retries

To process pending retries, add the following command to your app/Console/Kernel.php:

$schedule->command('retry:process')->everyMinute();

You can also filter retries by tag or ID:

php artisan retry:process --tag=erp
php artisan retry:process --id=1 --id=2 --id=3
php artisan retry:process --fingerprint=a8...

Disabling Middleware

If you need to retry requests without running the original route middleware (e.g., if authentication tokens have expired), use the --without-middleware option:

php artisan retry:process --without-middleware

Configuration

The published configuration file config/retry.php allows you to customize:

  • table_name: The table where retries are stored.
  • storage_disk: The disk used for temporary file storage (defaults to local).
  • max_retries: Global default for maximum retry attempts.
  • delay: The initial delay before the first retry attempt.

Events

The package dispatches events throughout the retry lifecycle:

  • LaravelRouteRetry\Events\RequestCaptured: Dispatched when a failure is first captured.
  • LaravelRouteRetry\Events\RetrySucceeded: Dispatched when a retry attempt results in a 2xx response.
  • LaravelRouteRetry\Events\RetryFailed: Dispatched when a retry fails or reaches the maximum limit.

License

The MIT License (MIT). Please see License File for more information.

filipefernandes/laravel-route-retry 适用场景与选型建议

filipefernandes/laravel-route-retry 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.23k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2026 年 01 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 filipefernandes/laravel-route-retry 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 filipefernandes/laravel-route-retry 我们能提供哪些服务?
定制开发 / 二次开发

基于 filipefernandes/laravel-route-retry 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1.23k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-09