Code Duplication    Length = 7-7 lines in 2 locations

src/FlashCard/Entity/Category.php 1 location

@@ 116-122 (lines=7) @@
113
     * @param  string  $keyword
114
     * @return Builder
115
     */
116
    public function scopeSearch(Builder $query, string $keyword): Builder
117
    {
118
        $query->where('title', 'LIKE', '%' . $keyword . '%');
119
        $query->orWhere('description', 'LIKE', '%' . $keyword . '%');
120
121
        return $query;
122
    }
123
}
124

src/FlashCard/Entity/Card.php 1 location

@@ 144-150 (lines=7) @@
141
     * @param  string  $keyword
142
     * @return Builder
143
     */
144
    public function scopeSearch(Builder $query, string $keyword): Builder
145
    {
146
        $query->where('title', 'LIKE', '%' . $keyword . '%');
147
        $query->orWhere('content', 'LIKE', '%' . $keyword . '%');
148
149
        return $query;
150
    }
151
152
    /**
153
     * Update card view counter by 1 and insert record in card view table