Code Duplication    Length = 8-8 lines in 2 locations

app/Category.php 1 location

@@ 27-34 (lines=8) @@
24
     */
25
    protected $fillable = ['name', 'icon', 'validity', 'created_by'];
26
27
    public function countAccounts($status = null)
28
    {
29
        $accounts = static::find($this->id)->accounts;
30
        if (false === is_null($status)) {
31
            $accounts = $accounts->where('status', $status);
32
        }
33
        return count($accounts);
34
    }
35
36
    public function accounts()
37
    {

app/Group.php 1 location

@@ 21-28 (lines=8) @@
18
     */
19
    protected $fillable = ['name', 'created_by'];
20
21
    public function countAccounts($status = null)
22
    {
23
        $accounts = static::find($this->id)->accounts;
24
        if (false === is_null($status)) {
25
            $accounts = $accounts->where('status', $status);
26
        }
27
        return count($accounts);
28
    }
29
30
    public function accounts()
31
    {