code16/sharp-ohdear-broken-links
Sharp OhDear Broken Links
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.
Related Packages
Scrutiny checks over your environment to make sure your app is running as it sho...
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v3.0.1 | 8.3.*| | ^12.0| | MIT | |
| v3.0.0 | 8.3.*| | ^12.0| | MIT | |
| v2.7.2 | 8.3.*| | ^10.0| | MIT | |
| v2.7.1 | ^8.3| | ^10.0| | MIT | |
| v2.7 | ^8.3| | ^10.0| | MIT | |
| v2.6.1 | ^8.3| | ^10.0| | MIT | |
| v2.6 | ^8.3| | ^10.0| | MIT | |
| v2.5 | ^8.2| | ^10.0| | MIT | |
| v2.4 | ^8.2| | ^10.0| | MIT | |
| v2.3 | ^8.2| | ^10.0| | MIT | |
| v2.2 | ^8.2| | ^10.0| | MIT | |
| v2.1 | ^8.2| | ^10.0| | MIT | |
| v2.0 | ^8.2| | ^10.0| | MIT | |
| v1.2.0 | ^8.2| | ^10.0| | MIT | |
| v1.1.0 | ^8.2 | ^10.0 | MIT | |
| v1.0.0 | ^8.2 | ^10.0 | MIT | |
| v0.4 | ^8.2 | ^10.0 | MIT | |
| v0.3 | ^8.2 | ^10.0 | MIT | |
| v0.2 | ^8.2 | ^10.0 | MIT | |
| v0.1 | ^8.2 | ^10.0 | MIT |