22 lines
527 B
PHP
22 lines
527 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use App\Actions\Prompts\StorePrompt;
|
|
|
|
class StorePromptRequest extends PromptFormRequest
|
|
{
|
|
/**
|
|
* Validated payload as a command DTO.
|
|
*/
|
|
public function toStorePrompt(): StorePrompt
|
|
{
|
|
return new StorePrompt(
|
|
name: (string) $this->validated('name'),
|
|
description: $this->validated('description'),
|
|
body: (string) $this->validated('body'),
|
|
tags: array_values((array) $this->validated('tags', [])),
|
|
);
|
|
}
|
|
}
|