定制 moinul/laravel-broken-link-scanner 二次开发

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

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

moinul/laravel-broken-link-scanner

Composer 安装命令:

composer require moinul/laravel-broken-link-scanner

包简介

Scan and report dead or broken links in your Laravel app

README 文档

README

Laravel Broken Link Scanner

A Laravel package to scan and report dead or broken links in your Laravel application. It crawls your website and identifies any broken links (4xx/5xx status codes).

Features

  • Asynchronous crawling with configurable concurrency
  • Configurable crawl depth
  • Export results to Excel
  • Web interface to view and manage broken links
  • Detailed progress reporting
  • Database storage of broken links
  • Support for Laravel 8.x, 9.x, 10.x, and 11.x

Installation

You can install the package via composer:

composer require moinul/laravel-broken-link-scanner

Configuration

  1. Publish the config file:
php artisan vendor:publish --provider="Moinul\LinkScanner\LinkScannerServiceProvider" --tag="config"
  1. Publish and run the migrations:
php artisan vendor:publish --provider="Moinul\LinkScanner\LinkScannerServiceProvider" --tag="migrations"
php artisan migrate
  1. (Optional) Publish the views if you want to customize them:
php artisan vendor:publish --provider="Moinul\LinkScanner\LinkScannerServiceProvider" --tag="views"

Usage

Command Line

Scan your site for broken links:

# Scan using config start_url
php artisan broken-links:scan

# Scan specific URL
php artisan broken-links:scan https://example.com

# Scan with custom depth
php artisan broken-links:scan --depth=3

# Clear old results before scanning
php artisan broken-links:scan --clear-old

# Show detailed progress
php artisan broken-links:scan -v

# Show very detailed progress
php artisan broken-links:scan -vv

# Show debug level information
php artisan broken-links:scan -vvv

Web Interface

The package provides a web interface at /broken-links to:

  • View all broken links
  • See status codes and reasons
  • Export results to Excel
  • Track when links were last checked

Configuration

You can configure the package by editing the config/broken-links.php file:

return [
    // The URL to start scanning from
    'start_url' => env('APP_URL', 'http://localhost'),

    // How many links deep should the crawler go? Set to -1 for unlimited
    'max_depth' => env('BROKEN_LINKS_MAX_DEPTH', 5),

    // How many URLs to check simultaneously
    'concurrency' => env('BROKEN_LINKS_CONCURRENCY', 10),

    // How long to wait for each request (in seconds)
    'timeout' => env('BROKEN_LINKS_TIMEOUT', 10),

    // The user agent string to use when making requests
    'user_agent' => env('BROKEN_LINKS_USER_AGENT', 'Laravel Broken Link Scanner'),

    // The database table to store broken links in
    'storage_table' => 'broken_links',
];

Programmatic Usage

You can also use the facade to scan programmatically:

use Moinul\LinkScanner\Facades\LinkScanner;

// Scan using config start_url
LinkScanner::scan();

// Scan specific URL
LinkScanner::scan('https://example.com');

Events

The package dispatches the following events:

  • BrokenLinkFound: When a broken link is discovered
  • ScanCompleted: When the scan is complete

Testing

composer test

Changelog

Please see CHANGELOG.md for more information on what has changed recently.

Contributing

Please see CONTRIBUTING.md for details.

Security

If you discover any security related issues, please email engrminul@gmail.com instead of using the issue tracker.

Credits

License

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

moinul/laravel-broken-link-scanner 适用场景与选型建议

moinul/laravel-broken-link-scanner 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 04 月 19 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 moinul/laravel-broken-link-scanner 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 12
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 20
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-19