Code Duplication    Length = 9-9 lines in 2 locations

src/Controllers/TicketControllable.php 2 locations

@@ 203-211 (lines=9) @@
200
            return abort(403);
201
        }
202
203
        if (! config('laravel-tickets.open-ticket-with-answer') && $ticket->state === 'CLOSED') {
204
            $message = trans('You cannot reply to a closed ticket');
205
            return \request()->wantsJson() ?
206
                response()->json(compact('message')) :
207
                back()->with(
208
                    'message',
209
                    $message
210
                );
211
        }
212
213
        $data = $request->validate([
214
            'message' => [ 'required', 'string' ],
@@ 255-263 (lines=9) @@
252
            ! request()->user()->can(config('laravel-tickets.permissions.all-ticket'))) {
253
            return abort(403);
254
        }
255
        if ($ticket->state === 'CLOSED') {
256
            $message = trans('The ticket is already closed');
257
            return \request()->wantsJson() ?
258
                response()->json(compact('message')) :
259
                back()->with(
260
                    'message',
261
                    $message
262
                );
263
        }
264
        $ticket->update([ 'state' => 'CLOSED' ]);
265
266
        $message = trans('The ticket was successfully closed');