- add make:dto command which generates dto in App\Data namespace - varient: --input (default), --output
31 lines
644 B
Plaintext
31 lines
644 B
Plaintext
<?php
|
|
|
|
namespace {{ namespace }};
|
|
|
|
use App\Contracts\InputDataTransferObject;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
final readonly class {{ class }} implements InputDataTransferObject
|
|
{
|
|
public function __construct(
|
|
// TODO: Define your properties here
|
|
) {}
|
|
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(): array
|
|
{
|
|
return [
|
|
// TODO: Map properties to array
|
|
];
|
|
}
|
|
|
|
public static function fromRequest(FormRequest $request): InputDataTransferObject
|
|
{
|
|
return new self(
|
|
// TODO: Map request data to properties
|
|
);
|
|
}
|
|
}
|