@@ -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(); |
@@ -185,11 +185,11 @@ |
||
| 185 | 185 | { |
| 186 | 186 | $search = $this->search ?? null; |
| 187 | 187 | if ($search != '') { |
| 188 | - return Post::where(function ($query) use ($search) { |
|
| 189 | - $query->where('name', 'LIKE', '%' . $search . '%') |
|
| 190 | - ->orWhere('excerpt', 'LIKE', '%' . $search . '%') |
|
| 191 | - ->orWhere('seo_name', 'LIKE', '%' . $search . '%') |
|
| 192 | - ->orWhere('meta_description', 'LIKE', '%' . $search . '%'); |
|
| 188 | + return Post::where(function($query) use ($search) { |
|
| 189 | + $query->where('name', 'LIKE', '%'.$search.'%') |
|
| 190 | + ->orWhere('excerpt', 'LIKE', '%'.$search.'%') |
|
| 191 | + ->orWhere('seo_name', 'LIKE', '%'.$search.'%') |
|
| 192 | + ->orWhere('meta_description', 'LIKE', '%'.$search.'%'); |
|
| 193 | 193 | }); |
| 194 | 194 | } else { |
| 195 | 195 | return Post::latest(); |
@@ -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'); |