diff --git a/readme.md b/readme.md index 52824fa..e5dd488 100755 --- a/readme.md +++ b/readme.md @@ -6,6 +6,20 @@ [![Latest Unstable Version](https://poser.pugx.org/LaravelCollective/annotations/v/unstable.svg)](https://packagist.org/packages/laravelcollective/annotations) [![License](https://poser.pugx.org/LaravelCollective/annotations/license.svg)](https://packagist.org/packages/laravelcollective/annotations) +### Introduction + +The Annotations package by Laravel Collective allows developers to define routes, event listeners, and model bindings using PHP annotations inside Controller, Event handler, and Model classes. Eliminating the need for manual route registration and event handling configuration outside of those classes. By scanning specific classes and applying predefined annotations, this package automates essential parts of your Laravel application, making it more concise and easier to maintain. + +### Why Use This Package? + +- **Simplifies Route Registration**: Define your routes directly within controller methods using annotations like `@Get`, `@Post`, and `@Resource`, reducing the need for explicit route definitions in `routes/web.php`. + + It scans the controllers listed in the `$scanRoutes` array of your `AnnotationsServiceProvider`; or scan all controllers in `\App\Http\Controllers` with `$scanControllers = true`. +- **Automates Event Handling**: Use @Hears to attach event listeners directly to methods inside your event handler classes, and the package will scan the classes listed in `$scanEvents` to register them automatically. You no longer need to define event listeners manually by mapping them in `EventServiceProvider::$listen`. +- **Enhances Model Binding**: Automatically bind models to route parameters using `@Bind`, eliminating the need for manual `Route::model()` definition in `AppServiceProvider::boot()`. It scans models listed in `$scanModels`. +- **Customizable and Extensible**: Define your own annotation classes to extend functionality according to your application's needs. +- **Scalable Scanning Mechanism**: Choose between scanning specific controllers, models, or events, or enabling `scanEverything` for automatic detection across your application's namespace. + # Annotations - [Installation](#installation)