Yii application example uses the first type. I’m thinking the second alternative might put files together in a single folder that have tighter coupling. E.g. PostController has tight coupling with PostEntity, PostRepository, PostDTO, etc, not so much with CommentController.
Second alternative might be better to isolate change.