How 365werk/etagconditionals works
Project type and purpose
• This is a Laravel package (PHP library) that provides HTTP middleware for setting ETags and handling conditional requests (If-Match, If-None-Match) in any Laravel-based API. It plugs into the Laravel HTTP pipeline.
File structure
• Top‐level files:
• composer.json, LICENSE, readme.md, changelog.md, phpunit.xml – standard package configuration.
• config/etagconditionals.php – package default config.
• src/… – package source code.
• src/EtagConditionalsServiceProvider.php – Laravel service provider, registers config merge and middleware.
• src/Facades/EtagConditionals.php – Laravel façade to expose static API.
• src/Middleware/SetEtag.php, IfMatch.php, IfNoneMatch.php, Middleware.php – actual middleware classes and base.
• tests/… – PHPUnit tests for each middleware and the façade.
README for additional insights
• Describes three middleware and how they behave.
• Shows how the service provider publishes config.
• Allows customization of ETag algorithm via a callback.
Detail is key
– Show all three middleware individually rather than lumping into one “ETag Middleware.”
– Call out the ServiceProvider registration step (on boot: mergeConfig, register middleware aliases).