Skip to content

HTTP Request object passed to domain layer #11

@Prabeg29

Description

@Prabeg29

The HTTP Request object has been passed to service classes. This hints to the code being highly coupled with Request Object that too is from the framework. This makes testing difficult as one has to mock this heavy request object. Just the data required should be passed to the domain layer, not HTTP-related objects. If objects are to be sent, DTOs could be an option.

class UserService
{
public static function saveUserData($request)
{
$validated = $request->validated();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions