Conversation
|
Works for plural modelling too: public function __construct(
private readonly ListDistrictsAction $action
) {
}
public function __invoke(ListDistrictsRequest $request): array
{
$districts = $this->action->run($request);
return $this->transform($districts, DistrictTransformer::class);
} |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 8.x #194 +/- ##
==========================================
- Coverage 4.26% 4.26% -0.01%
Complexity 668 668
==========================================
Files 92 92
Lines 2742 2746 +4
==========================================
Hits 117 117
- Misses 2625 2629 +4 ☔ View full report in Codecov by Sentry. |
|
@innoflash Thank you for this! 💪 |
Sure, take your time. I may have found a couple more things I think I can help solve on the framework. |
|
@Mohammad-Alavi where is the test file for the controller generation so I can add a test for this addition? |
673a5e5 to
db9a9cb
Compare
Description
This PR aims to solve the issue I mentioned on #193
The controller generator seems to be misbehaving and we eventually have a need to go fix the generated code.
Short version is controllers are built with the wrong model.
Type of change
I simply added a

modeloption to the inputs.Updated command is:
php artisan apiato:generate:controller --container Locations --model DistrictThe model can also be requested for if one isnt provided in the command
The generated file has this code:
This now makes use of the desired model in this container