PHPackages                             builtforsmallbusiness/laravel-404-monitor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. builtforsmallbusiness/laravel-404-monitor

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

builtforsmallbusiness/laravel-404-monitor
=========================================

A 404 monitoring dashboard for Laravel with SEO and Googlebot tracking

v1.0.4(1mo ago)716MITBladePHP ^8.1

Since May 31Pushed 1w agoCompare

[ Source](https://github.com/Builtforsmallbusiness/laravel-404-monitor)[ Packagist](https://packagist.org/packages/builtforsmallbusiness/laravel-404-monitor)[ RSS](/packages/builtforsmallbusiness-laravel-404-monitor/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (5)Versions (6)Used By (0)

laravel-404-monitor
===================

[](#laravel-404-monitor)

A lightweight 404 monitoring dashboard for Laravel applications. Track missing pages, identify broken internal links, monitor Googlebot crawl errors, and understand where your 404 traffic comes from — all without touching a log file.

[![Laravel](https://camo.githubusercontent.com/93554d1ac44e7880097a6bd117e99f90c33ddf03dcf0a37f3047fa50b8aaa4d2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302532422d726564)](https://camo.githubusercontent.com/93554d1ac44e7880097a6bd117e99f90c33ddf03dcf0a37f3047fa50b8aaa4d2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302532422d726564) [![PHP](https://camo.githubusercontent.com/83dd395020c37276225039739320f6c8e7e99963ab21ee3d09282cb48dad2a60/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c7565)](https://camo.githubusercontent.com/83dd395020c37276225039739320f6c8e7e99963ab21ee3d09282cb48dad2a60/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c7565) [![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)

Features
--------

[](#features)

- **Automatic tracking** — no manual instrumentation, middleware registers itself
- **Source detection** — classifies each 404 as `bot`, `internal`, `external`, or `direct`
- **Googlebot flag** — instantly see which missing pages search engines are hitting (critical for SEO)
- **Hit counts** — see which URLs are repeatedly failing, not just that they failed once
- **Last seen timestamps** — know if a problem is ongoing or historical
- **Built-in dashboard** — clean UI with search, source filtering, and clear actions
- **Zero dependencies** — no frontend framework required, dashboard is self-contained

Installation
------------

[](#installation)

```
composer require builtforsmallbusiness/laravel-404-monitor
```

Publish and run the migration:

```
php artisan vendor:publish --tag=404monitor-migrations
php artisan migrate
```

Publish the config (optional):

```
php artisan vendor:publish --tag=404monitor-config
```

That's it. The middleware registers itself automatically via the service provider.

After installing, run this to confirm the dashboard URL:

```
php artisan 404monitor:info
```

Protecting the Dashboard
------------------------

[](#protecting-the-dashboard)

By default, the dashboard is denied to all users until you explicitly grant access. This is intentional — the package does not assume how your application manages admin access.

To grant access, add a gate definition to your `App\Providers\AppServiceProvider`:

```
use Illuminate\Support\Facades\Gate;

public function boot(): void
{
    Gate::define('view-404-monitor', function ($user) {
        return $user->is_admin; // your own logic here
    });
}
```

### Common examples

[](#common-examples)

**Using a boolean column on your users table:**

```
Gate::define('view-404-monitor', function ($user) {
    return $user->is_admin;
});
```

**Using a role string:**

```
Gate::define('view-404-monitor', function ($user) {
    return $user->role === 'admin';
});
```

**Using Spatie Laravel Permission:**

```
Gate::define('view-404-monitor', function ($user) {
    return $user->hasRole('admin');
});
```

**Allowing specific emails (useful for small apps):**

```
Gate::define('view-404-monitor', function ($user) {
    return in_array($user->email, [
        'you@yourdomain.com',
    ]);
});
```

**Local environment only (during development):**

```
Gate::define('view-404-monitor', function ($user) {
    return app()->environment('local');
});
```

> **Note:** The gate receives the currently authenticated user. Make sure your dashboard route is also protected by the `auth` middleware (set by default in `config/404monitor.php`).

Dashboard
---------

[](#dashboard)

Access the dashboard at `/_404-monitor` (requires authentication by default).

To customise the route prefix or middleware, publish the config:

```
// config/404monitor.php

'route_prefix' => '_404-monitor',   // change the URL
'middleware'   => ['web', 'auth'],  // protect with your own middleware
```

Configuration
-------------

[](#configuration)

```
return [
    // Enable/disable the dashboard UI
    'dashboard_enabled' => true,

    // Dashboard URL prefix
    'route_prefix' => '_404-monitor',

    // Middleware applied to dashboard routes
    'middleware' => ['web', 'auth'],

    // URL patterns to skip (supports * wildcards)
    'ignored_urls' => [
        '/favicon.ico',
        '/apple-touch-icon*',
        '/robots.txt',
        '/.env',
        '/wp-*',
    ],

    // Partial user agent strings to ignore
    'ignored_user_agents' => [
        // 'SemrushBot',
        // 'AhrefsBot',
    ],

    // Days to retain records (null = keep forever)
    'retention_days' => 90,

    // Database table name
    'table_name' => 'failed_requests',
];
```

Source Types
------------

[](#source-types)

SourceMeaning`bot`Automated crawler or spider (includes Googlebot, Bingbot, etc.)`internal`Followed a link from within your own site — a broken internal link`external`Followed a link from another website — a stale backlink`direct`No referer — direct URL hit or unknown**Internal 404s are the most actionable** — they indicate broken links in your own content that you can fix immediately.

Cleaning Up Old Records
-----------------------

[](#cleaning-up-old-records)

Add the cleanup command to your scheduler to enforce the retention period:

```
// routes/console.php or app/Console/Kernel.php

Schedule::command('404monitor:clean')->daily();
```

Or run manually:

Artisan Commands
----------------

[](#artisan-commands)

CommandDescription`php artisan 404monitor:info`Display dashboard URL and setup info`php artisan 404monitor:clean`Remove records older than retention periodCustomising the Dashboard View
------------------------------

[](#customising-the-dashboard-view)

Publish the views to override them:

```
php artisan vendor:publish --tag=404monitor-views
```

Views will be copied to `resources/views/vendor/404monitor/`.

Using the Model Directly
------------------------

[](#using-the-model-directly)

```
use BuiltForSmallBusiness\Laravel404Monitor\Models\FailedRequest;

// Most-hit URLs
FailedRequest::orderByDesc('hit_count')->take(10)->get();

// Googlebot crawl errors
FailedRequest::googlebot()->get();

// Active in the last 24 hours
FailedRequest::recentlyActive(24)->get();

// Broken internal links
FailedRequest::where('source', 'internal')->get();
```

Why this exists
---------------

[](#why-this-exists)

We built this for [Built For Small Business](https://builtforsmallbusiness.com) after discovering that standard Laravel error logs give you no visibility into *patterns* of 404 errors. A single broken internal link generating 200 hits looks the same as 200 one-off bot probes — until you see the data in a dashboard.

The Googlebot tracking was the specific trigger: knowing which of your missing pages search engines are trying to crawl is directly actionable for SEO.

License
-------

[](#license)

MIT — see [LICENSE](LICENSE)

---

Built by [Built For Small Business](https://builtforsmallbusiness.com) · [Report an issue](https://github.com/builtforsmallbusiness/laravel-404-monitor/issues)

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance94

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

5

Last Release

51d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/58791428?v=4)[Josh Ade](/maintainers/iamjoshade)[@iamjoshade](https://github.com/iamjoshade)

---

Top Contributors

[![iamjoshade](https://avatars.githubusercontent.com/u/58791428?v=4)](https://github.com/iamjoshade "iamjoshade (11 commits)")

---

Tags

laravelmonitorseo404googlebotmissing-pages

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/builtforsmallbusiness-laravel-404-monitor/health.svg)

```
[![Health](https://phpackages.com/badges/builtforsmallbusiness-laravel-404-monitor/health.svg)](https://phpackages.com/packages/builtforsmallbusiness-laravel-404-monitor)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.6k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
