Skip to content

Commit ecc3075

Browse files
Merge pull request #5 from amitkolloldey/laravel-7
Laravel 7
2 parents b299824 + ff2d5f6 commit ecc3075

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

helpers/helpers.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,18 @@ function popular_tags_by_model(string $class, int $count = -1)
3030
$class
3131
)
3232
->select(
33-
DB::raw('count(tag_id) as post_count'),
33+
DB::raw('count(tag_id) as model_count'),
3434
'tag_id',
35-
'tags.name as tag_name'
35+
'tags.name as tag_name',
36+
'tags.description as tag_description',
37+
'tags.slug as tag_slug'
3638
)
3739
->groupBy(
3840
'tag_id',
3941
'tag_name'
4042
)
4143
->orderBy(
42-
'post_count',
44+
'model_count',
4345
'desc'
4446
)
4547
->take(

src/Scopes/TagScopes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function scopePopular($query, int $count = -1)
1919
}
2020

2121
/**
22-
* Gets Most Less Used Tags By Tag Count
22+
* Gets Less Used Tags By Tag Count
2323
*
2424
* @param $query
2525
* @param int $count

0 commit comments

Comments
 (0)