How can i to add the Last-Modified header for some actions in CatalogController.php?

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
РоманАндрейчук
Posts: 18
Joined: 13 Jan 2022, 15:08

How can i to add the Last-Modified header for some actions in CatalogController.php?

Post by РоманАндрейчук » 18 Jan 2023, 12:45

Hello. I am use next configuration: PHP7.4, Aimeos 2021.10, Laravel.

Can you advise me. How to add this header? So far I can see that I will need to override the entire controller and override routes for the actions I need. Can this be done easier?

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: How can i to add the Last-Modified header for some actions in CatalogController.php?

Post by aimeos » 19 Jan 2023, 16:37

Unfortunately, it's not possible easily in Laravel and you have to create your own controller and adapt the routes.

Another option might be to use a middleware similar to this one which adds the header:
https://github.com/abordage/laravel-last-modified
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
РоманАндрейчук
Posts: 18
Joined: 13 Jan 2022, 15:08

Re: How can i to add the Last-Modified header for some actions in CatalogController.php?

Post by РоманАндрейчук » 25 Jan 2023, 13:20

Thank you. I have seen this module. It is used in laravel controller. To use it, I have to override the entire CatalogController.

Post Reply