code16/sharp-ohdear-broken-links

This is my package sharp-ohdear-broken-links

Maintainers

👁 code16

Package info

github.com/code16/sharp-ohdear-broken-links

pkg:composer/code16/sharp-ohdear-broken-links

Statistics

Installs: 1 265

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v2.7.2 2026-04-13 09:15 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT c0c89172327d44ee0095496ef77635e845e94bea

  • Arnaud Becher <arnaud.becher.woop@gmail.com>
  • Lucien PUGET <lucien.puget.woop@code16.fr>

laravelbroken linkssharpohdear

This package is auto-updated.

Last update: 2026-06-13 09:40:21 UTC


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.