PHPackages                             goaop/goaop-laravel-bridge - 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. goaop/goaop-laravel-bridge

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

goaop/goaop-laravel-bridge
==========================

Integration bridge for Go! AOP framework

1.1.1(5y ago)9421.1k↓74.3%10[5 issues](https://github.com/goaop/goaop-laravel-bridge/issues)[1 PRs](https://github.com/goaop/goaop-laravel-bridge/pulls)MITPHP

Since Mar 6Pushed 2y ago8 watchersCompare

[ Source](https://github.com/goaop/goaop-laravel-bridge)[ Packagist](https://packagist.org/packages/goaop/goaop-laravel-bridge)[ RSS](/packages/goaop-goaop-laravel-bridge/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (2)Versions (7)Used By (0)

GoAopBridge
===========

[](#goaopbridge)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/588a76b1468cbbe6397501ce4d0bce1579529bd3ece58ac689ef0f029a10f103/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676f616f702f676f616f702d6c61726176656c2d6272696467652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/goaop/goaop-laravel-bridge/?branch=master)[![GitHub release](https://camo.githubusercontent.com/e03b8650fbb40e6635d7c5db86565db02197622b2d66ac505fe338e06f2791db/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f676f616f702f676f616f702d6c61726176656c2d6272696467652e737667)](https://github.com/goaop/goaop-laravel-bridge/releases/latest)[![Minimum PHP Version](https://camo.githubusercontent.com/dd6bad85ee03cf570f4cf82ab69a80396fdbf48050af932f8f23aa551b0d1e5a/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e352d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/0465ad2fed6acc285aa90ad12ded54790ed6dc6ab017fa84d92539e52b249726/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f676f616f702f676f616f702d6c61726176656c2d6272696467652e737667)](https://packagist.org/packages/goaop/goaop-laravel-bridge)

The GoAopBridge adds support for Aspect-Oriented Programming via Go! AOP Framework for Laravel5 applications.

Overview
--------

[](#overview)

Aspect-Oriented Paradigm allows to extend the standard Object-Oriented Paradigm with special instruments for effective solving of cross-cutting concerns in your application. This code is typically present everywhere in your application (for example, logging, caching, monitoring, etc) and there is no easy way to fix this without AOP.

AOP defines new instruments for developers, they are:

- Joinpoint - place in your code that can be used for interception, for example, execution of single public method or accessing of single object property.
- Pointcut is a list of joinpoints defined with a special regexp-like expression for your source code, for example, all public and protected methods in the concrete class or namespace.
- Advice is an additional callback that will be called before, after or around concrete joinpoint. For PHP each advice is represented as a `\Closure` instance, wrapped into the interceptor object.
- Aspect is a special class that combines pointcuts and advices together, each pointcut is defined as an annotation and each advice is a method inside this aspect.

You can read more about AOP in different sources, there are good articles for Java language and they can be applied for PHP too, because it's general paradigm. Alternatively, you can watch a [nice presentation about AOP in Laravel](http://slides.com/chrisflynn-1/aspect-oriented-architecture-in-laravel)

Installation
------------

[](#installation)

GoAopBridge can be easily installed with composer. Just ask a composer to download the bundle with dependencies by running the command:

```
$ composer require goaop/goaop-laravel-bridge
```

### Laravel 5.5+

[](#laravel-55)

No action is needed. After the command `composer require goaop/goaop-laravel-bridge` the package is installed and configured automatically. For a manual configuration, [follow these steps](#configuration).

### Laravel 5.4 or less

[](#laravel-54-or-less)

Add the `Go\Laravel\GoAopBridge\GoAopServiceProvider` to your config/app.php `providers` array:

```
// config/app.php

    'providers' => [
        // Go! Aspect Service Provider
        Go\Laravel\GoAopBridge\GoAopServiceProvider::class,
```

Make sure that this service provider is the **first item** in this list. This is required for the AOP engine to work correctly.

### Lumen

[](#lumen)

Register the `Go\Laravel\GoAopBridge\GoAopServiceProvider` to the app in your bootstrap/app.php:

```
// bootstrap/app.php
