@@ -163,7 +163,7 @@ |
||
| 163 | 163 | */ |
| 164 | 164 | protected function registerRoutes() |
| 165 | 165 | { |
| 166 | - Route::group($this->routeConfiguration(), function () { |
|
| 166 | + Route::group($this->routeConfiguration(), function() { |
|
| 167 | 167 | $this->loadRoutesFrom(__DIR__.'/../../routes/web.php'); |
| 168 | 168 | }); |
| 169 | 169 | } |
@@ -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 | |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | public function scopeTenent($query) |
| 11 | 11 | { |
| 12 | 12 | if (Auth::user()->exists()) { |
| 13 | - if (! Auth::user()->hasRole('superadmin') || ! Auth::user()->hasRole('admin')) { |
|
| 13 | + if (!Auth::user()->hasRole('superadmin') || !Auth::user()->hasRole('admin')) { |
|
| 14 | 14 | return $query->where('author_id', Auth::user()->id); |
| 15 | 15 | } else { |
| 16 | 16 | return $query->whereNotNull('id'); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | public function scopeTrending($query, $limit = 12) |
| 106 | 106 | { |
| 107 | - return $query->with('author', 'tagged')->published()->get()->sortByDesc(function ($p) { |
|
| 107 | + return $query->with('author', 'tagged')->published()->get()->sortByDesc(function($p) { |
|
| 108 | 108 | return $p->weight; |
| 109 | 109 | })->take($limit); |
| 110 | 110 | } |
@@ -195,7 +195,7 @@ |
||
| 195 | 195 | { |
| 196 | 196 | $search = $this->search ?? null; |
| 197 | 197 | if ($search != '') { |
| 198 | - return Post::where(function ($query) use ($search) { |
|
| 198 | + return Post::where(function($query) use ($search) { |
|
| 199 | 199 | $query->where('name', 'LIKE', '%'.$search.'%') |
| 200 | 200 | ->orWhere('excerpt', 'LIKE', '%'.$search.'%') |
| 201 | 201 | ->orWhere('seo_name', 'LIKE', '%'.$search.'%') |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | public function featuredChanged(Post $post) |
| 15 | 15 | { |
| 16 | 16 | $post->update([ |
| 17 | - 'featured' => ! $post->featured, |
|
| 17 | + 'featured' => !$post->featured, |
|
| 18 | 18 | ]); |
| 19 | 19 | |
| 20 | 20 | $this->post = $post; |