litespeedtech / lscache-laravel

LSCache for Laravel framework
GNU General Public License v3.0
51 stars 14 forks source link

isMethodCacheable not found error for laravel 5.2 #10

Closed huniqcast closed 4 years ago

huniqcast commented 4 years ago

The isMethodCacheable method exists in symfony/http-foundation/Request.php in the recent version of symfony but symfony version used by Laravel 5.2 doesn't have this method inside te Request class.

I think for backward compatibility the raw code from isMethodCacheable is be used directly :

\in_array($this->getMethod(), ['GET', 'HEAD']);

What do you think about it ?

As I have issue using this plugin inside my website.

lucasRolff commented 4 years ago

Hi @huniqcast

I've changed the code to not rely on isMethodCacheable and in my local dev, it seems to work at least.

If you can try to pull in dev-master via composer for the package, and confirm it works for you as well, then I'll tag it in a new version!

huniqcast commented 4 years ago

Hi @lucasRolff

It works well but you also need to apply the same code inside LSTagsMiddleware. With these change, it works well now. When you will publish the next release I will re-install it to get all new changes.

Thank for your effort.

lucasRolff commented 4 years ago

Hi @huniqcast

Sorry for the late reply - Github notifications apparently didn't arrive in my inbox!

I've fixed the LSTagsMiddleware as well, and I've pushed v1.3.1

Thanks for your bug report!