Package Data | |
---|---|
Maintainer Username: | mikebronner |
Maintainer Contact: | hello@genealabs.com (Mike Bronner) |
Package Create Date: | 2015-11-11 |
Package Last Update: | 2021-04-29 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-17 03:01:30 |
Package Statistics | |
---|---|
Total Downloads: | 300 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 30 |
Total Watchers: | 3 |
Total Forks: | 1 |
Total Open Issues: | 1 |
Eliminate error and server log entries that get thrown by missing favicons, especially the apple-touch-icon.png errors.
If you are seeing errors in your server logs, its for a reason: favicons are custom representations of your site, and its probably good to implemented them. This just provides a better user experience for the various devices and browsers that want them.
However, there are times when we just don't want to deal with this, and are spinning up in-house or small experimental projects that won't be used publicly like that. That's what this package is for. Simply add it via composer, and add middleware entry as describe below, and it will return 404s for the missing favicons without cluttering your logs.
composer require genealabs/laravel-appleseed
app/Http/Kernel.php
directly after the maintenance mode middleware:/*
protected $middleware = [
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
*/
\GeneaLabs\LaravelAppleseed\Http\Middleware\FaviconInterceptor::class,
/*
[...]
];
*/
That was it! It will inspect each route for favicon requests and handle it appropriately.
Jesse Leite (@jesseleite85) provided lots of ideas and input on making this happen. Thanks!