Skip to content
This repository has been archived by the owner on Oct 24, 2018. It is now read-only.

Commit

Permalink
Updated README and fixed PSR2
Browse files Browse the repository at this point in the history
  • Loading branch information
billmn committed Oct 3, 2016
1 parent af8104e commit 7d3f707
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Quality Score](https://img.shields.io/scrutinizer/g/spatie/laravel-partialcache.svg?style=flat-square)](https://scrutinizer-ci.com/g/spatie/laravel-partialcache)
[![Total Downloads](https://img.shields.io/packagist/dt/spatie/laravel-partialcache.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-partialcache)

This package provides a Blade directive for Laravel 5.1 to cache rendered partials in laravel.
This package provides a Blade directive for Laravel >=5.1 to cache rendered partials in Laravel.

Spatie is a webdesign agency in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource).

Expand All @@ -18,19 +18,19 @@ You can install the package via Composer:
$ composer require spatie/laravel-partialcache
```

Start by registering the package's the service provider and facade:
Start by registering the package's service provider and facade:

```php
// config/app.php

'providers' => [
...
'Spatie\PartialCache\PartialCacheServiceProvider',
Spatie\PartialCache\PartialCacheServiceProvider::class,
],

'aliases' => [
...
'PartialCache' => 'Spatie\PartialCache\PartialCacheFacade',
'PartialCache' => Spatie\PartialCache\PartialCacheFacade::class,
],
```

Expand Down Expand Up @@ -79,7 +79,7 @@ Note that this caches the rendered html, not the rendered php like blade's defau

### Clearing The PartialCache

You can forget a partialcache entry with `PartialCache::forget($view, $key)`.
You can forget a partialcache entry with `PartialCache::forget($view, $key)`.

```php
PartialCache::forget('user.profile', $user->id);
Expand Down
8 changes: 4 additions & 4 deletions resources/config/partialcache.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

return [

// Enable or disable partialcache alltogether
'enabled' => 'true',

// The name of the blade directive to register
'directive' => 'cache',

// The base key that used for cache items
'key' => 'partialcache',
'key' => 'partialcache',

];
6 changes: 3 additions & 3 deletions src/PartialCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function __construct(View $view, Cache $cache, CacheManager $cacheManager
*/
public function cache($data, $view, $mergeData = null, $minutes = null, $key = null, $tag = null)
{
if (!$this->enabled) {
if (! $this->enabled) {
return call_user_func($this->renderView($view, $data, $mergeData));
}

Expand All @@ -83,7 +83,7 @@ public function cache($data, $view, $mergeData = null, $minutes = null, $key = n
$tags = [$this->cacheKey];

if ($tag) {
if (!is_array($tag)) {
if (! is_array($tag)) {
$tag = [$tag];
}

Expand Down Expand Up @@ -157,7 +157,7 @@ public function forget($view, $key = null)
*/
public function flush($tag = null)
{
if (!$this->cacheIsTaggable) {
if (! $this->cacheIsTaggable) {
throw new MethodNotSupportedException('The cache driver ('.
get_class($this->cacheManager->driver()).') doesn\'t support the flush method.');
}
Expand Down

0 comments on commit 7d3f707

Please sign in to comment.