src/Traits/FormatsValidJsonResponses.php
public function validSuccessJsonResponse($message = 'Success', $data = [], $redirect = null)
    {
        return response()->json(
            [
                'code' => '200',
                'message' => $message,
                'data' => $data,
                'errors' => [],
                'redirect' => $redirect,
            ], 200, [], JSON_PRETTY_PRINT
        );
    }
public function validSuccessJsonResponse($message = 'Success', $data = [], $redirect = null)
    {
        return response()->json(
            [
                'code' => '200',
                'message' => $message,
                'data' => $data,
                'errors' => [],
                'redirect' => $redirect,
            ], 200, [], JSON_PRETTY_PRINT
        );
    }
public function validSuccessJsonResponse ( $ message = 'Success' , $ data = [ ] , $ redirect = null ) { return response ( ) -> json ( [ 'code' => '200' , 'message' => $ message , 'data' => $ data , 'errors' => [ ] , 'redirect' => $ redirect , ] , 200 , [ ] , JSON_PRETTY_PRINT ) ; }
Return a valid 200 Success json response.

@param string $message  The response message.
@param array  $data     The passed data.
@param string $redirect The redirection url.

@return \Illuminate\Http\JsonResponse
Return a valid 200 Success json response .