@@ -41,8 +41,8 @@ |
||
| 41 | 41 | $id = $this->page->id ?? ''; |
| 42 | 42 | |
| 43 | 43 | return [ |
| 44 | - 'slug' => 'required|max:255|unique:pages,slug,' . $id, |
|
| 45 | - 'code' => 'required|max:255|unique:pages,slug,' . $id, |
|
| 44 | + 'slug' => 'required|max:255|unique:pages,slug,'.$id, |
|
| 45 | + 'code' => 'required|max:255|unique:pages,slug,'.$id, |
|
| 46 | 46 | 'name' => 'required|max:255', |
| 47 | 47 | 'meta_name' => 'nullable|max:255', |
| 48 | 48 | 'body' => 'nullable|max:65535', |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | } |
| 98 | 98 | public function scopeTrending($query, $limit = 12) |
| 99 | 99 | { |
| 100 | - return $query->with('author', 'tagged')->published()->get()->sortByDesc(function ($p) { |
|
| 100 | + return $query->with('author', 'tagged')->published()->get()->sortByDesc(function($p) { |
|
| 101 | 101 | return $p->weight; |
| 102 | 102 | })->take($limit); |
| 103 | 103 | } |
@@ -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; |
@@ -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'); |