PHPackages                             accentinteractive/laravel-ignore-extensions - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. accentinteractive/laravel-ignore-extensions

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

accentinteractive/laravel-ignore-extensions
===========================================

Do not process URLs with a extensions like .jpg, .png et cetera.

v2.0.0(1y ago)219MITPHPPHP ^7.3|^7.4|^8.0CI failing

Since Jan 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/accentinteractive/laravel-ignore-extensions)[ Packagist](https://packagist.org/packages/accentinteractive/laravel-ignore-extensions)[ Docs](https://github.com/accentinteractive/laravel-ignore-extensions)[ RSS](/packages/accentinteractive-laravel-ignore-extensions/feed)WikiDiscussions main Synced yesterday

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

Return 404 on all URLs that have certain extensions
===================================================

[](#return-404-on-all-urls-that-have-certain-extensions)

[![Latest Version on Packagist](https://camo.githubusercontent.com/688b70012b38d01594723ca42c835ce6dddd59a7d957fafd39c0bac3f362caa9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616363656e74696e7465726163746976652f6c61726176656c2d69676e6f72652d657874656e73696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/accentinteractive/laravel-ignore-extensions)[![Total Downloads](https://camo.githubusercontent.com/7e081ffd8c6182dfde1c4dca3d713c264e5415041995b4f89a3d77f6c30d6ab5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616363656e74696e7465726163746976652f6c61726176656c2d69676e6f72652d657874656e73696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/accentinteractive/laravel-ignore-extensions)[![GitHub Actions](https://github.com/accentinteractive/laravel-ignore-extensions/actions/workflows/main.yml/badge.svg)](https://github.com/accentinteractive/laravel-ignore-extensions/actions/workflows/main.yml/badge.svg)

If your application has a fallback route like `Route::get({slug})`, call to non-existent assets are processed by Laravel - causing strain on your server. If a lot of assets are not presenent (like on a staging server) this can even bring your application to a grinding halt.

This package contains middleware that aborts the request if it contains certain extensions, that you set in your .env file.

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

[](#installation)

Step 1: Install the package via composer:

```
composer require accentinteractive/laravel-ignore-extensions
```

Step 2: Make sure to register the Middleware.

To use it on all requests, add it as the first option to the `web` section under `$middlewareGroups` in file app/Http/Kernel.php.

```
protected $middlewareGroups = [
    'web' => [
        \Accentinteractive\LaravelIgnoreExtensions\Http\Middleware\DoNotProcessExtensions::class,
    ],
];
```

To use it on specific requests, add it to any group or to the `protected $middleware` property in file app/Http/Kernel.php.

```
protected $middleware = [
        \Accentinteractive\LaravelIgnoreExtensions\Http\Middleware\DoNotProcessExtensions::class,
    ];
```

Step 3: Optionally publish the config file with:

```
php artisan vendor:publish --provider="Accentinteractive\LaravelIgnoreExtensions\LaravelIgnoreExtensionsServiceProvider" --tag="config"

```

Config for this package is stored in `config('laravel-ignore-extensions')`

Usage
-----

[](#usage)

The package uses auto discover. The package uses a middleware class that does the checking and aborting.

Config settings
---------------

[](#config-settings)

### Setting extensions that should return a 404

[](#setting-extensions-that-should-return-a-404)

You can set the extensions to check for in the published config file, or by setting this values in .env. It defaults to 'jpg|gif|png|jpeg|txt|html|pdf|css|js'

```
EXTENSIONS_NOT_TO_PROCESS=jpg|gif|png|jpeg|txt|html|pdf|css|js
```

### Testing

[](#testing)

```
vendor/bin/phpunit tests
XDEBUG_MODE=coverage vendor/bin/phpunit tests --coverage-html code-coverage
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Joost van Veen](https://github.com/accentinteractive)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance49

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90% 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 ~446 days

Total

3

Last Release

373d ago

Major Versions

v0.1.0 → v1.0.02023-07-10

v1.0.0 → v2.0.02025-06-26

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/356020?v=4)[Accent Interactive](/maintainers/accentinteractive)[@accentinteractive](https://github.com/accentinteractive)

---

Top Contributors

[![joostvanveen](https://avatars.githubusercontent.com/u/540294?v=4)](https://github.com/joostvanveen "joostvanveen (9 commits)")[![accentinteractive](https://avatars.githubusercontent.com/u/356020?v=4)](https://github.com/accentinteractive "accentinteractive (1 commits)")

---

Tags

accentinteractivelaravel-ignore-extensions

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/accentinteractive-laravel-ignore-extensions/health.svg)

```
[![Health](https://phpackages.com/badges/accentinteractive-laravel-ignore-extensions/health.svg)](https://phpackages.com/packages/accentinteractive-laravel-ignore-extensions)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M195](/packages/laravel-ai)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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