Describe the bug
When running make:resource command, the stub generated has the Request object passed as the only method parameter. In reality, the JsonResource doesn't actually get the request passed, so the method signature doesn't match the parent class.
To Reproduce
Steps to reproduce the behavior:
run wp radiate make:resource TestResource
inspect the newly created resource
attempt to dump the $request parameter
Expected behavior
The dumped $request parameter to output a Radiate\Http\Request instance
Additional context
The JsonResource::toArray method doesn't get passed the Request. It should in order to replicate the same functionality of Laravel, or the stub shouldn't include the parameter if the resource is deemed to not require it.
IMO the resource should get an instance of the request, or even have all dependencies resolved from the container. This would give great flexibility when building the resource.
Describe the bug When running
make:resource
command, the stub generated has theRequest
object passed as the only method parameter. In reality, theJsonResource
doesn't actually get the request passed, so the method signature doesn't match the parent class.To Reproduce Steps to reproduce the behavior:
wp radiate make:resource TestResource
$request
parameterExpected behavior The dumped
$request
parameter to output aRadiate\Http\Request
instanceAdditional context The
JsonResource::toArray
method doesn't get passed theRequest
. It should in order to replicate the same functionality of Laravel, or the stub shouldn't include the parameter if the resource is deemed to not require it.IMO the resource should get an instance of the request, or even have all dependencies resolved from the container. This would give great flexibility when building the resource.