Slim's controllers receive PSR-7 Request and Response objects. The problem is that I want to use my own SomeCustomRequest classes that extends Slim's one in different controller's actions. I know how to set my own Request and Response classes in container but then it will be used for all the controllers. I don't want this.
Example:
class UserController {
public function store(CreateRequest $request, Response $response) {
// Some logic to create user using CreateRequest
}
public function update(UpdateRequest $request, Response $response) {
// Some logic to update user using UpdateRequest
}
}
Is it possible to inject proper custom Request class into action? Like Laravel does it.
Thanks a lot for any advice!