@@ -18,11 +18,11 @@ |
||
| 18 | 18 | { |
| 19 | 19 | parent::boot(); |
| 20 | 20 | |
| 21 | - static::saving(function () { |
|
| 21 | + static::saving(function() { |
|
| 22 | 22 | self::cacheKey(); |
| 23 | 23 | }); |
| 24 | 24 | |
| 25 | - static::deleting(function () { |
|
| 25 | + static::deleting(function() { |
|
| 26 | 26 | self::cacheKey(); |
| 27 | 27 | }); |
| 28 | 28 | } |
@@ -18,11 +18,11 @@ |
||
| 18 | 18 | { |
| 19 | 19 | parent::boot(); |
| 20 | 20 | |
| 21 | - static::saving(function () { |
|
| 21 | + static::saving(function() { |
|
| 22 | 22 | self::cacheKey(); |
| 23 | 23 | }); |
| 24 | 24 | |
| 25 | - static::deleting(function () { |
|
| 25 | + static::deleting(function() { |
|
| 26 | 26 | self::cacheKey(); |
| 27 | 27 | }); |
| 28 | 28 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | public function indexTemplate() |
| 14 | 14 | { |
| 15 | 15 | $templates = config('adminetic.caching', true) |
| 16 | - ? (Cache::has('templates') ? Cache::get('templates') : Cache::rememberForever('templates', function () { |
|
| 16 | + ? (Cache::has('templates') ? Cache::get('templates') : Cache::rememberForever('templates', function() { |
|
| 17 | 17 | return Template::latest()->get(); |
| 18 | 18 | })) |
| 19 | 19 | : Template::latest()->get(); |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | { |
| 13 | 13 | $posts = Cache::get('posts', Post::with('category', 'author', 'tagged')->latest()->get()); |
| 14 | 14 | |
| 15 | - return $posts->sortByDesc(function ($p) use ($post) { |
|
| 15 | + return $posts->sortByDesc(function($p) use ($post) { |
|
| 16 | 16 | $post_tags = $post->tags->pluck('name')->toArray(); |
| 17 | 17 | $tag_weight = $p->withAnyTag($post_tags)->exists() ? (5 / 100) * $p->weight : 0; |
| 18 | 18 | $category_weight = $p->category->id == $post->category_id ? (10 / 100) * $p->weight : 0; |
@@ -18,11 +18,11 @@ |
||
| 18 | 18 | { |
| 19 | 19 | parent::boot(); |
| 20 | 20 | |
| 21 | - static::saving(function () { |
|
| 21 | + static::saving(function() { |
|
| 22 | 22 | self::cacheKey(); |
| 23 | 23 | }); |
| 24 | 24 | |
| 25 | - static::deleting(function () { |
|
| 25 | + static::deleting(function() { |
|
| 26 | 26 | self::cacheKey(); |
| 27 | 27 | }); |
| 28 | 28 | } |
@@ -18,11 +18,11 @@ |
||
| 18 | 18 | { |
| 19 | 19 | parent::boot(); |
| 20 | 20 | |
| 21 | - static::saving(function () { |
|
| 21 | + static::saving(function() { |
|
| 22 | 22 | self::cacheKey(); |
| 23 | 23 | }); |
| 24 | 24 | |
| 25 | - static::deleting(function () { |
|
| 25 | + static::deleting(function() { |
|
| 26 | 26 | self::cacheKey(); |
| 27 | 27 | }); |
| 28 | 28 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('posts', function (Blueprint $table) { |
|
| 16 | + Schema::create('posts', function(Blueprint $table) { |
|
| 17 | 17 | $table->id(); |
| 18 | 18 | $table->string('slug')->unique(); |
| 19 | 19 | $table->string('code')->unique(); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('templates', function (Blueprint $table) { |
|
| 16 | + Schema::create('templates', function(Blueprint $table) { |
|
| 17 | 17 | $table->id(); |
| 18 | 18 | $table->string('name'); |
| 19 | 19 | $table->text('template'); |
@@ -14,34 +14,34 @@ |
||
| 14 | 14 | // Post Index |
| 15 | 15 | public function indexPost() |
| 16 | 16 | { |
| 17 | - Cache::rememberForever('posts', function () { |
|
| 17 | + Cache::rememberForever('posts', function() { |
|
| 18 | 18 | return Post::with('author')->latest()->get(); |
| 19 | 19 | }); |
| 20 | - Cache::rememberForever('latest_limited_posts', function () { |
|
| 20 | + Cache::rememberForever('latest_limited_posts', function() { |
|
| 21 | 21 | return Post::latestLimitedPosts()->get(); |
| 22 | 22 | }); |
| 23 | - Cache::rememberForever('featured_limited_posts', function () { |
|
| 23 | + Cache::rememberForever('featured_limited_posts', function() { |
|
| 24 | 24 | return Post::featuredLimitedPosts()->get(); |
| 25 | 25 | }); |
| 26 | - Cache::rememberForever('limited_breaking_news', function () { |
|
| 26 | + Cache::rememberForever('limited_breaking_news', function() { |
|
| 27 | 27 | return Post::limitedBreakingNews()->get(); |
| 28 | 28 | }); |
| 29 | - Cache::rememberForever('limited_hot_news', function () { |
|
| 29 | + Cache::rememberForever('limited_hot_news', function() { |
|
| 30 | 30 | return Post::limitedHotNews()->get(); |
| 31 | 31 | }); |
| 32 | - Cache::rememberForever('limited_trending_posts', function () { |
|
| 32 | + Cache::rememberForever('limited_trending_posts', function() { |
|
| 33 | 33 | return Post::trending(); |
| 34 | 34 | }); |
| 35 | - Cache::rememberForever('limited_priority_posts', function () { |
|
| 35 | + Cache::rememberForever('limited_priority_posts', function() { |
|
| 36 | 36 | return Post::limitedPriorityPosts()->get(); |
| 37 | 37 | }); |
| 38 | - Cache::rememberForever('yesterday_most_visited_posts', function () { |
|
| 38 | + Cache::rememberForever('yesterday_most_visited_posts', function() { |
|
| 39 | 39 | return Post::yesterdayMostVisitedPosts()->get(); |
| 40 | 40 | }); |
| 41 | - Cache::rememberForever('week_most_visited_posts', function () { |
|
| 41 | + Cache::rememberForever('week_most_visited_posts', function() { |
|
| 42 | 42 | return Post::weekMostVisitedPosts()->get(); |
| 43 | 43 | }); |
| 44 | - Cache::rememberForever('most_visited_posts_chunked', function () { |
|
| 44 | + Cache::rememberForever('most_visited_posts_chunked', function() { |
|
| 45 | 45 | return Post::mostVisitedPostsChunked(); |
| 46 | 46 | }); |
| 47 | 47 | |