PHPackages                             larachimp/pine-annotations - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. larachimp/pine-annotations

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

larachimp/pine-annotations
==========================

Easing annotations reading in Laravel

v3.0.1(4y ago)87.6k41MITPHPPHP ^7.3|^8.0

Since Jul 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/LaraChimp/pine-annotations)[ Packagist](https://packagist.org/packages/larachimp/pine-annotations)[ RSS](/packages/larachimp-pine-annotations/feed)WikiDiscussions develop Synced 2d ago

READMEChangelog (10)Dependencies (7)Versions (16)Used By (1)

 [![](https://raw.githubusercontent.com/LaraChimp/art-work/master/packages/pine-annotations/pine-annotations.png)](https://raw.githubusercontent.com/LaraChimp/art-work/master/packages/pine-annotations/pine-annotations.png) Pine Annotations
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#-------pine-annotations)

 [![Latest Stable Version](https://camo.githubusercontent.com/287c89dcad35c46e995f59f675d1b09224340cce30ba3150ffa814e03a7a82fe/68747470733a2f2f706f7365722e707567782e6f72672f6c6172616368696d702f70696e652d616e6e6f746174696f6e732f762f737461626c65)](https://packagist.org/packages/larachimp/pine-annotations) [![Latest Unstable Version](https://camo.githubusercontent.com/ca857999fbf510892f45d680689888f9c743d5a419460e808df44b5fe2c6c6ca/68747470733a2f2f706f7365722e707567782e6f72672f6c6172616368696d702f70696e652d616e6e6f746174696f6e732f762f756e737461626c65)](https://packagist.org/packages/larachimp/pine-annotations) [![Build Status](https://camo.githubusercontent.com/eea05b4604953e988a5f16effff3e19bc7f45eb14d1b5d8bee6b88f97f94f139/68747470733a2f2f7472617669732d63692e6f72672f4c6172614368696d702f70696e652d616e6e6f746174696f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/LaraChimp/pine-annotations) [![StyleCI](https://camo.githubusercontent.com/e869732971e6e243a9f5d17aef7be001f38b9814698186c5b9a96cda2a8dcf18/68747470733a2f2f7374796c6563692e696f2f7265706f732f39333636353930302f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/93665900) [![License](https://camo.githubusercontent.com/c9de583a04bd1d509bf15b5b08a2976669622409cde69f51902aa85363c89643/68747470733a2f2f706f7365722e707567782e6f72672f6c6172616368696d702f70696e652d616e6e6f746174696f6e732f6c6963656e7365)](https://packagist.org/packages/larachimp/pine-annotations) [![Total Downloads](https://camo.githubusercontent.com/c4c68bd946430867334de8ef678c7f565589ab53b46dada4974d30e473eb0240/68747470733a2f2f706f7365722e707567782e6f72672f6c6172616368696d702f70696e652d616e6e6f746174696f6e732f646f776e6c6f616473)](https://packagist.org/packages/larachimp/pine-annotations) [![](https://camo.githubusercontent.com/d0d5d262b8bb790c68ea9e8a9feda9acb22c6d54cbe09628652e2b3e29cfaa9d/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f38386262393962622d656233652d346436382d626664362d3931326461333563366438372f6d696e692e706e67)](https://insight.sensiolabs.com/projects/88bb99bb-eb3e-4d68-bfd6-912da35c6d87)

Introduction
------------

[](#introduction)

Pine Annotations package makes creating and reading annotations seamlessly in any laravel 5 project. Behind the scenes Pine Annotations make use of the doctrine-annotations project, but tries to simplify its integration with Laravel 5.

License
-------

[](#license)

Pine Annotations is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

Version Compatibility
---------------------

[](#version-compatibility)

LaravelPine Annotations5.x.x0.x6.x1.x7.x2.x8.x3.x### Installation

[](#installation)

```
$ composer require larachimp/pine-annotations
```

### Configuration

[](#configuration)

> If you are using Laravel &gt;= 5.5, you can skip service registration thanks to Laravel auto package discovery feature.

After installation all you need is to register the `LaraChimp\PineAnnotations\PineAnnotationsServiceProvider`in your `config/app.php` configuration file:

```
'providers' => [
    ...
    LaraChimp\PineAnnotations\PineAnnotationsServiceProvider::class,
],
```

You can also register the `Reader` alias which helps in reading object's annotations.

```
'aliases' => [
    ...
    'AnnotationsReader' => LaraChimp\PineAnnotations\Facades\Reader::class,
]
```

You can now publish config using the command:

```
$ php artisan vendor:publish
```

This will create the file `pine-annotations.php` in your config directory.

### Registering your annotations in the AnnotationRegistry

[](#registering-your-annotations-in-the-annotationregistry)

The config file `pine-annotations.php` has two sections `autoload_files` and `autoload_namespaces`.

#### autoload\_files

[](#autoload_files)

```
'autoload_files' => [
    app_path('Annotations/FooAnnotation.php'),
],
```

In this array you may include the file paths of all your annotations classes. These will get registered in the `AnnotationRegistry`. You can include as many files as you need.

#### autoload\_namespaces

[](#autoload_namespaces)

```
'autoload_namespaces' => [
    'App\Annotations',
],
```

This array contains the namespaces of your annotations classes. This is useful if you want to register all annotations classes of a whole namespace in a single go.

#### Using the Reader to manually add entries to the Registry.

[](#using-the-reader-to-manually-add-entries-to-the-registry)

Alternatively you may use the methods `addFilesToRegistry()` and `addNamespacesToRegistry()` to perform manual entries of files and namespaces to the annotation registry.

```
// Adding files manually to the Registry.
AnnotationsReader::addFilesToRegistry($filesPaths);
```

```
// Adding namespaces manually to the Registry.
AnnotationsReader::addNamespacesToRegistry($namespaces);
```

> It is imperative that you register your annotations classes in one way or the other with the Reader. Otherwise AnnotationsReader won't be able to parse them.

### The AnnotationsReader

[](#the-annotationsreader)

To create an instance of the `AnnotationsReader`, use the Laravel's IOC to either inject or create it via the `app()` method or `App` facade:

```
