# think-annotation for ThinkPHP6 > PHP8版本 ## 安装 > composer require topthink/think-annotation ## 配置 > 配置文件位于 `config/annotation.php` ## 使用方法 ### 路由注解 ~~~php 默认会扫描controller目录下的所有类 > 可对个别目录单独配置 ```php //... 'route' => [ 'enable' => true, 'controllers' => [ app_path('controller/admin') => [ 'name' => 'admin/api', 'middleware' => [], ], root_path('other/controller') ], ], //... ``` ### 模型注解 ~~~php