{"repo":"spatie/laravel-varnish","free":true,"listed":false,"github":"https://github.com/spatie/laravel-varnish","clone":"git clone https://github.com/spatie/laravel-varnish.git","description":"Making Varnish and Laravel play nice together","language":"PHP","stars":417,"topics":["laravel","php","varnish","performance","caching"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Making Varnish and Laravel play nice together This package provides an easy way to work with Varnish 4 (or 5) in Laravel. It provides a route middleware that, when applied to a route, will make sure Varnish will cache the response no matter what. The package also contains a function to flush the Varnish cache from within the application. Support us We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products. We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall. Installation We assume that you've already installed Varnish on your server. If not read this blogpost to learn how to install it. You can install the package via composer: The package will automatically register itself for Laravel 5.5+. If you are using Laravel < 5.5, you also need to add Varnish\\VarnishServiceProvider to your config/app.php providers array: Next if you use Laravel you must publish the config-file with: and if you use Lumen, you must copy config/varnish.php file to your application config folder. This is the contents of the published file: In the published varnish.php config file you should set the host key to the right value. Add the Spatie\\Varnish\\Middleware\\CacheWithVarnish middleware to the route middlewares. For Laravel: If you are using Lumen, you need to","default_branch":null,"files":null,"tree":[],"storefront":"/r/spatie","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/spatie/laravel-varnish/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}