lpcdernoncourt/annotations

Route Annotations for The Laravel Framework.

v5.5.1 2017-11-20 18:45 UTC

README

To Laravel 5.5

Build Status Total Downloads Latest Stable Version Latest Unstable Version License

Official documentation for Annotations for The Laravel Framework can be found at the LaravelCollective website.

Installation

Add Presenter to your composer.json file:

"require": {
    "lpcdernoncourt/annotations": "5.5.*"
}

Now, run a composer update on the command line from the root of your project:

composer update

Once composer is done, you'll need to create a Service Provider in app/Providers/AnnotationsServiceProvider.php.

<?php namespace App\Providers;

use Collective\Annotations\AnnotationsServiceProvider as ServiceProvider;

class AnnotationsServiceProvider extends ServiceProvider {

    /**
     * The classes to scan for event annotations.
     *
     * @var array
     */
    protected $scanEvents = [];

    /**
     * The classes to scan for route annotations.
     *
     * @var array
     */
    protected $scanRoutes = [];

    /**
     * The classes to scan for model annotations.
     *
     * @var array
     */
    protected $scanModels = [];

    /**
     * Determines if we will auto-scan in the local environment.
     *
     * @var bool
     */
    protected $scanWhenLocal = false;

    /**
     * Determines whether or not to automatically scan the controllers
     * directory (App\Http\Controllers) for routes
     *
     * @var bool
     */
    protected $scanControllers = false;

    /**
     * Determines whether or not to automatically scan all namespaced
     * classes for event, route, and model annotations.
     *
     * @var bool
     */
    protected $scanEverything = false;

}

Registering the Package

Include the service provider within app/config/app.php. The service povider is needed for the generator artisan command.

'providers' => [
    // ...
    App\Providers\AnnotationsServiceProvider::class
    // ...
  ];