Code Duplication    Length = 13-15 lines in 2 locations

src/Http/Controllers/EventVenueController.php 1 location

@@ 143-157 (lines=15) @@
140
     * @param  \App\EventVenue  $eventVenue
141
     * @return \Illuminate\Http\Response
142
     */
143
    public function edit(EventVenue $eventVenue)
144
    {
145
        if (Auth::user()->id == $eventVenue->created_by || Auth::user()->isSuperAdmin() || Auth::user()->isAdmin()) {
146
            $authorUserId = $this->getLoggedAuthorId();
147
            $users = User::pluck('name', 'id');
148
            $countries = Country::getCountries();
149
150
            return view('eventVenues.edit', compact('eventVenue'))
151
                ->with('countries', $countries)
152
                ->with('users', $users)
153
                ->with('authorUserId', $authorUserId);
154
        } else {
155
            return redirect()->route('home')->with('message', __('auth.not_allowed_to_access'));
156
        }
157
    }
158
159
    /***************************************************************************/
160

src/Http/Controllers/OrganizerController.php 1 location

@@ 118-130 (lines=13) @@
115
     * @param  \App\Organizer  $organizer
116
     * @return \Illuminate\Http\Response
117
     */
118
    public function edit(Organizer $organizer)
119
    {
120
        if (Auth::user()->id == $organizer->created_by || Auth::user()->isSuperAdmin() || Auth::user()->isAdmin()) {
121
            $authorUserId = $this->getLoggedAuthorId();
122
            $users = User::pluck('name', 'id');
123
124
            return view('organizers.edit', compact('organizer'))
125
                ->with('users', $users)
126
                ->with('authorUserId', $authorUserId);
127
        } else {
128
            return redirect()->route('home')->with('message', __('auth.not_allowed_to_access'));
129
        }
130
    }
131
132
    /***************************************************************************/
133