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(10mo ago)216MITPHPPHP ^7.3|^7.4|^8.0CI failing

Since Jan 15Pushed 10mo 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 1mo ago

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 75% of packages

Maintenance54

Moderate activity, may be stable

Popularity9

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

320d 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

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[aedart/athenaeum

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

255.2k](/packages/aedart-athenaeum)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[glhd/conveyor-belt

14797.0k](/packages/glhd-conveyor-belt)[pulkitjalan/ip-geolocation

IP Geolocation Wrapper with Laravel Support

89164.9k1](/packages/pulkitjalan-ip-geolocation)

PHPackages © 2026

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