定制 code16/sharp-ohdear-broken-links 二次开发

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

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

code16/sharp-ohdear-broken-links

Composer 安装命令:

composer require code16/sharp-ohdear-broken-links

包简介

This is my package sharp-ohdear-broken-links

README 文档

README

A Laravel package designed to be used with Sharp to display broken links from your OhDear monitoring.

Installation

composer require code16/sharp-ohdear-broken-links

Usage

This package is designed to add a broken links' list in your Sharp back-office. It uses the OhDear env keys to connect to OhDear API, you need at least OH_DEAR_MONITOR_ID and OH_DEAR_API_TOKEN.

Optionally, you can publish the package configuration with:

php artisan vendor:publish --tag=sharp-ohdear-broken-links-config

In your Sharp Configuration Service Provider, add the broken links' entity :

class SharpConfigServiceProvider extends SharpAppServiceProvider
{
    protected function configureSharp(SharpConfigBuilder $config): void
    {
        $config
            ->setName('Your beautiful project')
            ->setSharpMenu(AppSharpMenu::class)
            ->discoverEntities()
            ->declareEntity(Code16\SharpOhdearBrokenLinks\Sharp\Entities\BrokenLinkEntity::class); // <-- declare the package entity here
    }

Then add it to your sharp menu:

class AppSharpMenu extends SharpMenu
{
    public function build(): self
    {
        // [...]
        return $this
           ->addEntityLink(
                entityKeyOrClassName: Code16\SharpOhdearBrokenLinks\Sharp\Entities\BrokenLinkEntity::class, 
                label: 'Broken links', 
                icon: 'fas-link-slash',
                badge: fn () => BrokenLinksService::isConfigured() ? BrokenLinksService::make()->getBrokenLinksCount() : null, // facultative, adds a count badge on the menu item
            );
    }
}

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固