PHPackages                             perturbatio/cachetags - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. perturbatio/cachetags

ActiveLibrary[Templating &amp; Views](/categories/templating)

perturbatio/cachetags
=====================

Provides a partial caching mechanism for use with Laravel's Blade templating language or in normal PHP with the helpers

v2.1.0(3y ago)215.5k1MITPHP

Since Sep 17Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Perturbatio/CacheTags)[ Packagist](https://packagist.org/packages/perturbatio/cachetags)[ RSS](/packages/perturbatio-cachetags/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (6)Versions (11)Used By (0)

CacheTags - Laravel blade partial caching
=========================================

[](#cachetags---laravel-blade-partial-caching)

[![CircleCI](https://camo.githubusercontent.com/cd6a5d24e3f6a801e21e3e34ad0a2f24c0d032c3c851600105d88554a3f4bea5/68747470733a2f2f636972636c6563692e636f6d2f67682f506572747572626174696f2f4361636865546167732f747265652f6d61737465722e7376673f7374796c653d736869656c64)](https://circleci.com/gh/Perturbatio/CacheTags/tree/master)[![Latest Stable Version](https://camo.githubusercontent.com/6ced7d0c703230d4b884490d7b20993c689350fe839f998572a2aff03592f056/68747470733a2f2f706f7365722e707567782e6f72672f706572747572626174696f2f6361636865746167732f762f737461626c653f666f726d61743d666c6174)](https://packagist.org/packages/perturbatio/cachetags)[![Latest Unstable Version](https://camo.githubusercontent.com/a11099444e70882e8e27b02209a5dca39df84e2e15dc263fb2ce1ca31dd103db/68747470733a2f2f706f7365722e707567782e6f72672f706572747572626174696f2f6361636865746167732f762f756e737461626c653f666f726d61743d666c6174)](https://packagist.org/packages/perturbatio/cachetags)[![License](https://camo.githubusercontent.com/b7a72adfcac4a46eb857de7fb3f231b78d36e3349477e8b5fd4077efc4365947/68747470733a2f2f706f7365722e707567782e6f72672f706572747572626174696f2f6361636865746167732f6c6963656e73653f666f726d61743d666c6174)](https://packagist.org/packages/perturbatio/cachetags)[![Total Downloads](https://camo.githubusercontent.com/ab4243b9627bd1643173d8a3308b5051c1d9f14b326177435adf99562afd8c43/68747470733a2f2f706f7365722e707567782e6f72672f706572747572626174696f2f6361636865746167732f646f776e6c6f6164733f666f726d61743d666c6174)](https://packagist.org/packages/perturbatio/cachetags)

This package is intended to allow you to cache portions of a web page by marking them using blade directives.

You can specify how long the partial will be cached for as well as naming it (to allow you to invalidate it if needed).

Nesting cacheTags is also possible, meaning that inner content will be cached at least as long as the outer cache is

Installation
------------

[](#installation)

Install it as a composer package with:

```
composer require perturbatio/cachetags

```

Add `Perturbatio\CacheTags\CacheTagsProvider::class` to your config/app.php providers array

Add `'CacheTags' => Perturbatio\CacheTags\CacheTags::class` to your aliases

Then publish the config file with `php artisan vendor:publish --tag=config` this will create a `cachetag.php` config file in `/config`

Usage
-----

[](#usage)

### Caching items

[](#caching-items)

#### Blade

[](#blade)

```
@cachetagStart('super-cool-widget', 15)
