Completed
Branch master (a6481d)
by Fèvre
02:12
created

ArticleRepository::sidebar()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace Xetaravel\Models\Repositories;
3
4
use Illuminate\Support\Collection;
5
use Xetaravel\Models\Article;
6
7
class ArticleRepository
8
{
9
    /**
10
     * Find the latest articles for the sidebar.
11
     *
12
     * @return \Illuminate\Database\Eloquent\Collection
13
     */
14
    public static function sidebar(): Collection
15
    {
16
        return Article::latest()->take(5)->get();
17
    }
18
}
19