diff --git a/src/Routing.php b/src/Attributes/AfterMiddleware.php old mode 100755 new mode 100644 similarity index 59% rename from src/Routing.php rename to src/Attributes/AfterMiddleware.php index ac14ceb3..7268df3a --- a/src/Routing.php +++ b/src/Attributes/AfterMiddleware.php @@ -1,5 +1,7 @@ + * @license https://mozilla.org/MPL/2.0/ MPL-2.0 + */ + +namespace Rudra\Router\Attributes; + +#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Middleware +{ + public function __construct( + public string $name, + public string|null $params = null + ) {} +} diff --git a/src/Attributes/Routing.php b/src/Attributes/Routing.php new file mode 100755 index 00000000..d7472e5b --- /dev/null +++ b/src/Attributes/Routing.php @@ -0,0 +1,21 @@ + + * @license https://mozilla.org/MPL/2.0/ MPL-2.0 + */ + +namespace Rudra\Router\Attributes; + +#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Routing +{ + public function __construct( + public string $url = '', + public string|array $method = 'GET' + ) {} +}