Download the PHP package dragon-code/last-modified without Composer
On this page you can find all versions of the php package dragon-code/last-modified. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dragon-code/last-modified
More information about dragon-code/last-modified
Files in dragon-code/last-modified
Package last-modified
Short Description Setting the response code 304 Not Modified in the absence of content changes.
License MIT
Informations about the package last-modified
Last Modified for Laravel
Setting the response code 304 Not Modified in the absence of content changes.
Installation
To get the latest version of Last Modified
simply require the project using Composer:
Instead, you may of course manually update your require block and run composer update
if you so choose:
And call php artisan vendor:publish --provider="DragonCode\LastModified\ServiceProvider"
command.
Note
If you were using version 2.0 or less, run the
php artisan migrate
command. If this is your first time here, then you do not need to install this command, since, starting from version 2.1, we refused to store data in the database, replacing the storage with a cache.
Next, add middleware in $middlewareGroups > web
section in app/Http/Kernel.php
file:
IMPORTANT! It's recommended to add a middleware after CheckForMaintenanceMode::class
.
The system works like this: when opening a page, the middleware checks if there is an entry in the database table about this link. If there is, it checks the Last-Modified
header
key and returns either 200 or 304 code.
To add records to the table, it is recommended to create a console command in your application using the following example:
Create / Update
IMPORTANT! The url
attribute must be available for models.
If the model has no attribute url
, it should be created.
For example:
Delete
Observer
In order to reduce the load on the database and free up the crown queue, it is recommended to use the observer to update the records:
Don't forget to add the link to the service provider:
License
This package is licensed under the MIT License.
All versions of last-modified with dependencies
doctrine/dbal Version ^2.6 || ^3.0
dragon-code/laravel-cache Version ^3.3
dragon-code/simple-dto Version ^2.3
dragon-code/support Version ^6.0
fig/http-message-util Version ^1.1
illuminate/console Version >=6.0 <12.0
illuminate/database Version >=6.0 <12.0
illuminate/support Version >=6.0 <12.0
lmc/http-constants Version ^1.2
nesbot/carbon Version ^1.20 || ^2.0 || ^3.0
psr/http-message Version ^1.0.1 || ^2.0