validate([ 'name' => ['required', 'string', 'max:255'], 'color' => ['required', 'string', 'max:7', 'regex:/^#[0-9A-Fa-f]{6}$/'], ]); $label = CreateLabel::execute($request->user()->currentWorkspace, $validated); return Response::structured($label->toArray()); } public function schema(JsonSchema $schema): array { return [ 'name' => $schema->string()->required()->description('The label name.'), 'color' => $schema->string()->required()->description('Hex color code (e.g. #FF5733).'), ]; } }