Total Complexity | 3 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class UserRepository |
||
12 | { |
||
13 | /** |
||
14 | * Find the authors of articles with most articles for the sidebar. |
||
15 | * |
||
16 | * @return \Illuminate\Database\Eloquent\Collection |
||
17 | */ |
||
18 | public static function sidebar(): Collection |
||
19 | { |
||
20 | return User::where('blog_article_count', '>=', 1) |
||
21 | ->take(config('xetaravel.blog.users_sidebar')) |
||
22 | ->orderBy('blog_article_count', 'desc') |
||
23 | ->get(); |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * Create a new user instance after a valid registration. |
||
28 | * |
||
29 | * @param array $data The data used to create the user. |
||
30 | * @param array $providerData The additional data provided by the provider. |
||
31 | * @param bool $provider Whether the user is registered with a Social Provider. |
||
32 | * |
||
33 | * @return User |
||
34 | */ |
||
35 | public static function create(array $data, array $providerData = [], bool $provider = false): User |
||
56 | } |
||
57 | } |
||
58 |