From 4c6b64e23bedc6aaf2abe3ae4d617868e328fc3c Mon Sep 17 00:00:00 2001 From: Alex Luneburg Date: Fri, 5 Nov 2021 09:02:10 +1300 Subject: [PATCH] Update readme with new namespaces for custom annotations --- readme.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/readme.md b/readme.md index 6a5cd6f..06f035b 100755 --- a/readme.md +++ b/readme.md @@ -177,12 +177,13 @@ class MailHandler { } ``` -or if you prefer to use attributes, set `$useAttribute` to `true` and do this. +or if you prefer to use attributes, set `$useAttribute` to `true` and do this. Note that unlike annotations, a use statement is required for the attribute. ```php ## Custom Annotations +_Please Note: the namespaces have been updated in version 8.1 in order to allow PHP 8 attribute support._ -If you want to register your own annotations, create a namespace containing subclasses of `Collective\Annotations\Routing\Annotations\Annotations\Annotation` - let's say `App\Http\Annotations`. +If you want to register your own annotations, create a namespace containing subclasses of `Collective\Annotations\Routing\Meta` - let's say `App\Http\Annotations`.\ +(_For version 8.0 and older, extend `Collective\Annotations\Routing\Annotations\Annotations\Annotation`_) Then, in your annotations service provider, override the `addRoutingAnnotations( RouteScanner $scanner )` method, and register your routing annotations namespace: ```php