Code Duplication    Length = 11-11 lines in 3 locations

app/Http/Controllers/Admin/Blog/ArticleController.php 1 location

@@ 105-115 (lines=11) @@
102
     *
103
     * @return \Illuminate\Http\RedirectResponse
104
     */
105
    public function update(Request $request, int $id): RedirectResponse
106
    {
107
        $article = Article::findOrFail($id);
108
109
        ArticleValidator::update($request->all(), $id)->validate();
110
        ArticleRepository::update($request->all(), $article);
111
112
        return redirect()
113
            ->route('admin.blog.article.index')
114
            ->with('success', 'Your article has been updated successfully !');
115
    }
116
117
    /**
118
     * Handle the delete request for the article.

app/Http/Controllers/Admin/Blog/CategoryController.php 1 location

@@ 92-102 (lines=11) @@
89
     *
90
     * @return \Illuminate\Http\RedirectResponse
91
     */
92
    public function update(Request $request, int $id): RedirectResponse
93
    {
94
        $category = Category::findOrFail($id);
95
96
        CategoryValidator::update($request->all(), $id)->validate();
97
        CategoryRepository::update($request->all(), $category);
98
99
        return redirect()
100
            ->route('admin.blog.category.index')
101
            ->with('success', 'Your category has been updated successfully !');
102
    }
103
104
    /**
105
     * Handle the delete request for the category.

app/Http/Controllers/Admin/Role/PermissionController.php 1 location

@@ 93-103 (lines=11) @@
90
     *
91
     * @return \Illuminate\Http\RedirectResponse
92
     */
93
    public function update(Request $request, int $id): RedirectResponse
94
    {
95
        $permission = Permission::findOrFail($id);
96
97
        PermissionValidator::update($request->all(), $permission->id)->validate();
98
        PermissionRepository::update($request->all(), $permission);
99
100
        return redirect()
101
            ->route('admin.role.permission.index')
102
            ->with('success', 'This permission has been updated successfully !');
103
    }
104
105
    /**
106
     * Handle the delete request for the permission.