Code Duplication    Length = 7-9 lines in 2 locations

Repositories/Eloquent/EloquentMenuItemRepository.php 1 location

@@ 34-40 (lines=7) @@
31
     * @param  int    $menuId
32
     * @return object
33
     */
34
    public function rootsForMenu($menuId)
35
    {
36
        return $this->model->whereHas('translations', function (Builder $q) {
37
            $q->where('status', 1);
38
            $q->where('locale', App::getLocale());
39
        })->with('translations')->whereMenuId($menuId)->orderBy('position')->get();
40
    }
41
42
    /**
43
     * Get all root elements

Repositories/Eloquent/EloquentMenuRepository.php 1 location

@@ 31-39 (lines=9) @@
28
     * Get all online menus
29
     * @return object
30
     */
31
    public function allOnline()
32
    {
33
        $locale = App::getLocale();
34
35
        return $this->model->whereHas('translations', function (Builder $q) use ($locale) {
36
            $q->where('locale', "$locale");
37
            $q->where('status', 1);
38
        })->with('translations')->orderBy('created_at', 'DESC')->get();
39
    }
40
}
41