code16 / sharp-ohdear-broken-links
This is my package sharp-ohdear-broken-links
v2.4
2025-09-04 12:53 UTC
Requires
- php: ^8.2|^8.3|^8.4
- code16/sharp: ^8.0|^9.0
- illuminate/contracts: ^10.0|^11.0|^12.0
- ohdearapp/ohdear-php-sdk: ^4.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- nunomaduro/collision: ^7.9|^8.0
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(Code16\SharpOhdearBrokenLinks\Sharp\Entities\BrokenLinkEntity::class, 'Broken links', 'fas-link-slash'); } }
Credits
License
The MIT License (MIT). Please see License File for more information.