https://github.com/code16/sharp-ohdear-broken-links
https://github.com/code16/sharp-ohdear-broken-links
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/code16/sharp-ohdear-broken-links
- Owner: code16
- License: mit
- Created: 2023-05-25T08:30:53.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-10T12:57:28.000Z (11 months ago)
- Last Synced: 2025-06-13T23:04:48.229Z (7 months ago)
- Language: PHP
- Size: 27.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
## Sharp OhDear Broken Links
A Laravel package designed to be used with [Sharp](https://github.com/code16/sharp) to display [broken links from your OhDear monitoring](https://ohdear.app/features/broken-page-and-mixed-content-detection).
## Installation
```bash
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:
```bash
php artisan vendor:publish --tag=sharp-ohdear-broken-links-config
```
In your [Sharp Configuration Service Provider](https://sharp.code16.fr/docs/guide/#configuration-via-a-new-service-provider), add the broken links' entity :
```php
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:
```php
class AppSharpMenu extends SharpMenu
{
public function build(): self
{
// [...]
return $this
->addEntityLink(Code16\SharpOhdearBrokenLinks\Sharp\Entities\BrokenLinkEntity::class, 'Broken links', 'fas-link-slash');
}
}
```
## Credits
- [Arnaud Becher](https://github.com/smknstd)
- [Lucien PUGET](https://github.com/patrickepatate)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.