@@ -13,16 +13,16 @@ discard block |
||
| 13 | 13 | { |
| 14 | 14 | $relation = $this->$method(); |
| 15 | 15 | |
| 16 | - if (! $relation instanceof Relation) { |
|
| 16 | + if (!$relation instanceof Relation) { |
|
| 17 | 17 | throw new LogicException(get_class($this).'::'.$method.' must return a relationship instance.'); |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | $results = $this->cache([$method]) |
| 21 | - ->rememberForever(str_slug(get_called_class()) . "-{$method}", function () use ($relation) { |
|
| 21 | + ->rememberForever(str_slug(get_called_class())."-{$method}", function() use ($relation) { |
|
| 22 | 22 | return $relation->getResults(); |
| 23 | 23 | }); |
| 24 | 24 | |
| 25 | - return tap($results, function ($results) use ($method) { |
|
| 25 | + return tap($results, function($results) use ($method) { |
|
| 26 | 26 | $this->setRelation($method, $results); |
| 27 | 27 | }); |
| 28 | 28 | } |
@@ -36,19 +36,19 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | parent::boot(); |
| 38 | 38 | |
| 39 | - static::created(function () { |
|
| 39 | + static::created(function() { |
|
| 40 | 40 | self::flushCache(); |
| 41 | 41 | }); |
| 42 | 42 | |
| 43 | - static::deleted(function () { |
|
| 43 | + static::deleted(function() { |
|
| 44 | 44 | self::flushCache(); |
| 45 | 45 | }); |
| 46 | 46 | |
| 47 | - static::saved(function () { |
|
| 47 | + static::saved(function() { |
|
| 48 | 48 | self::flushCache(); |
| 49 | 49 | }); |
| 50 | 50 | |
| 51 | - static::updated(function () { |
|
| 51 | + static::updated(function() { |
|
| 52 | 52 | self::flushCache(); |
| 53 | 53 | }); |
| 54 | 54 | } |
@@ -12,16 +12,16 @@ discard block |
||
| 12 | 12 | { |
| 13 | 13 | $relation = $this->$method(); |
| 14 | 14 | |
| 15 | - if (! $relation instanceof Relation) { |
|
| 15 | + if (!$relation instanceof Relation) { |
|
| 16 | 16 | throw new LogicException(get_class($this).'::'.$method.' must return a relationship instance.'); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | $results = $this->cache([$method]) |
| 20 | - ->rememberForever(str_slug(get_called_class()) . "-{$method}", function () use ($relation) { |
|
| 20 | + ->rememberForever(str_slug(get_called_class())."-{$method}", function() use ($relation) { |
|
| 21 | 21 | return $relation->getResults(); |
| 22 | 22 | }); |
| 23 | 23 | |
| 24 | - return tap($results, function ($results) use ($method) { |
|
| 24 | + return tap($results, function($results) use ($method) { |
|
| 25 | 25 | $this->setRelation($method, $results); |
| 26 | 26 | }); |
| 27 | 27 | } |
@@ -35,19 +35,19 @@ discard block |
||
| 35 | 35 | { |
| 36 | 36 | parent::boot(); |
| 37 | 37 | |
| 38 | - static::created(function () { |
|
| 38 | + static::created(function() { |
|
| 39 | 39 | self::flushCache(); |
| 40 | 40 | }); |
| 41 | 41 | |
| 42 | - static::deleted(function () { |
|
| 42 | + static::deleted(function() { |
|
| 43 | 43 | self::flushCache(); |
| 44 | 44 | }); |
| 45 | 45 | |
| 46 | - static::saved(function () { |
|
| 46 | + static::saved(function() { |
|
| 47 | 47 | self::flushCache(); |
| 48 | 48 | }); |
| 49 | 49 | |
| 50 | - static::updated(function () { |
|
| 50 | + static::updated(function() { |
|
| 51 | 51 | self::flushCache(); |
| 52 | 52 | }); |
| 53 | 53 | } |