diff --git a/src/Attributes/head.php b/src/Attributes/head.php new file mode 100644 index 0000000..f5135df --- /dev/null +++ b/src/Attributes/head.php @@ -0,0 +1,6 @@ +getName() ); + $rules = [ + 'path' => 'required|string|regex:/^\//', + 'method' => 'required|string|in:GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS', + 'name' => 'nullable|string|regex:/^[a-zA-Z0-9_.-]+$/', + ]; + $validator = Validator::make( + [ + 'path' => $instance->path, + 'method' => $instance::method(), + 'name' => $instance->name, + ], + $rules + ); + if ($validator->fails()) { + $error = true; + } + $entry = new RouteDocEntry( class : $shortClass, action: $method->getName(),