Code Duplication    Length = 24-24 lines in 2 locations

app/Http/Controllers/MoviesController.php 2 locations

@@ 90-113 (lines=24) @@
87
     *
88
     * @param $id
89
     */
90
    public function activate($id)
91
    {
92
        $movie = Movies::find($id);
93
94
        if ($movie->visible == 0) {
95
            $movie->visible = 1;
96
            Session::flash('success', "Le film {$movie->title} a bien été activé");
97
        } else {
98
            $movie->visible = 0;
99
            Session::flash('success', "Le film {$movie->title} a bien été desactivé");
100
        }
101
102
        $movie->save();
103
104
        return Redirect::route('movies_index');
105
    }
106
107
    /**
108
     * Action qui va me permettre de metter en avant un film.
109
     *
110
     * @param $id
111
     */
112
    public function cover($id)
113
    {
114
        $movie = Movies::find($id);
115
116
        if ($movie->cover == 0) {
@@ 112-135 (lines=24) @@
109
     *
110
     * @param $id
111
     */
112
    public function cover($id)
113
    {
114
        $movie = Movies::find($id);
115
116
        if ($movie->cover == 0) {
117
            $movie->cover = 1;
118
            Session::flash('success', "Le film {$movie->title} a bien été mis en avant");
119
        } else {
120
            $movie->cover = 0;
121
            Session::flash('danger', "Le film {$movie->title} a bien été retiré de l'avant");
122
        }
123
124
        $movie->save();
125
126
        return Redirect::route('movies_index');
127
    }
128
129
    /**
130
     * Action of suppression.
131
     *
132
     * @param $id
133
     *
134
     * @return mixed
135
     */
136
    public function delete($id)
137
    {
138
        $movie = Movies::find($id);