app/Module/UserMessagesModule.php
public function postDeleteMessageAction(ServerRequestInterface $request, Tree $tree): ResponseInterface
    {
        $message_ids = (array) $request->get('message_id', []);

        DB::table('message')
            ->where('user_id', '=', Auth::id())
            ->whereIn('message_id', $message_ids)
            ->delete();

        if ($request->get('ctype') === 'user') {
            $url = route('user-page', ['ged' => $tree->name()]);
        } else {
            $url = route('tree-page', ['ged' => $tree->name()]);
        }

        return redirect($url);
    }
public function postDeleteMessageAction(ServerRequestInterface $request, Tree $tree): ResponseInterface
    {
        $message_ids = (array) $request->get('message_id', []);

        DB::table('message')
            ->where('user_id', '=', Auth::id())
            ->whereIn('message_id', $message_ids)
            ->delete();

        if ($request->get('ctype') === 'user') {
            $url = route('user-page', ['ged' => $tree->name()]);
        } else {
            $url = route('tree-page', ['ged' => $tree->name()]);
        }

        return redirect($url);
    }
public function postDeleteMessageAction ( ServerRequestInterface $ request , Tree $ tree ) : ResponseInterface { $ message_ids = ( array ) $ request -> get ( 'message_id' , [ ] ) ; DB :: table ( 'message' ) -> where ( 'user_id' , '=' , Auth :: id ( ) ) -> whereIn ( 'message_id' , $ message_ids ) -> delete ( ) ; if ( $ request -> get ( 'ctype' ) === 'user' ) { $ url = route ( 'user-page' , [ 'ged' => $ tree -> name ( ) ] ) ; } else { $ url = route ( 'tree-page' , [ 'ged' => $ tree -> name ( ) ] ) ; } return redirect ( $ url ) ; }
Delete one or messages belonging to a user.

@param ServerRequestInterface $request
@param Tree $tree

@return ResponseInterface
Delete one or messages belonging to a user .