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.2k↓72.4%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 2w ago

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

Go! AOP Laravel bridge
======================

[](#go-aop-laravel-bridge)

[![CI](https://github.com/goaop/goaop-laravel-bridge/actions/workflows/ci.yml/badge.svg)](https://github.com/goaop/goaop-laravel-bridge/actions/workflows/ci.yml)[![PHPStan Badge](https://camo.githubusercontent.com/0929547a3cb064dc1fe278c2e4f2fd36bd96ea6c29887ad482d297f0aef192c6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230362d627269676874677265656e2e7376673f7374796c653d666c6174266c696e6b3d68747470732533412532462532467068707374616e2e6f7267253246757365722d677569646525324672756c652d6c6576656c73)](https://camo.githubusercontent.com/0929547a3cb064dc1fe278c2e4f2fd36bd96ea6c29887ad482d297f0aef192c6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230362d627269676874677265656e2e7376673f7374796c653d666c6174266c696e6b3d68747470732533412532462532467068707374616e2e6f7267253246757365722d677569646525324672756c652d6c6576656c73)[![GitHub release](https://camo.githubusercontent.com/e03b8650fbb40e6635d7c5db86565db02197622b2d66ac505fe338e06f2791db/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f676f616f702f676f616f702d6c61726176656c2d6272696467652e737667)](https://github.com/goaop/goaop-laravel-bridge/releases/latest)[![Total Downloads](https://camo.githubusercontent.com/3a5a917e14973f3240ec0bb0683c762174f2bbb5b1e49518efcfa95971ee4ab8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676f616f702f676f616f702d6c61726176656c2d6272696467652e737667)](https://packagist.org/packages/goaop/goaop-laravel-bridge)[![Monthly Downloads](https://camo.githubusercontent.com/b070c0be7a7ceebeffd945813495ae5f28282c6a681bdb662f4d0b1b451fd1ad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f676f616f702f676f616f702d6c61726176656c2d6272696467652e737667)](https://packagist.org/packages/goaop/goaop-laravel-bridge)[![Minimum PHP Version](https://camo.githubusercontent.com/db2abc4c99337a799d57b191c749e512b551eaebf6ce7c37e0ea9eac2eb1b9f6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e342d3838393242462e737667)](https://www.php.net/supported-versions.php)[![License](https://camo.githubusercontent.com/0465ad2fed6acc285aa90ad12ded54790ed6dc6ab017fa84d92539e52b249726/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f676f616f702f676f616f702d6c61726176656c2d6272696467652e737667)](https://packagist.org/packages/goaop/goaop-laravel-bridge)[![Sponsor](https://camo.githubusercontent.com/bb12d9dc1322843f286cc097e773f46484771b3a0c3980fa8aebed6cb736e447/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53706f6e736f722d2545322539442541342545462542382538462d6c69676874677261793f7374796c653d666c6174266c6f676f3d676974687562)](https://github.com/sponsors/lisachenko)

Integration bridge for the [Go! AOP framework](https://github.com/goaop/framework) and Laravel. It boots the AOP engine early in the application lifecycle so aspects are woven into your classes transparently — no code generation steps, no manual proxies.

Why Aspect-Oriented Programming in Laravel?
-------------------------------------------

[](#why-aspect-oriented-programming-in-laravel)

Some logic doesn't belong to any single class, yet ends up copied into hundreds of them: logging, caching, metrics, transactions, authorization checks, rate limiting, retry policies. Laravel's middleware solves this for HTTP requests — AOP solves it for **any method in your codebase**. Define the behavior once as an aspect, declare *where* it applies with a pointcut expression, and the engine weaves it in automatically. Your services stay pure business logic.

### ✨ Highlights

[](#-highlights)

- 🪡 **Transparent weaving** — aspects are applied by transforming classes at load time. No base classes to extend, no interfaces to implement, no `Proxy` wrappers to maintain, no changes to how you `new` or inject your services.
- 🏷️ **Modern PHP 8 attributes** — advices are declared with `#[Before]`, `#[After]`, `#[Around]` and `#[AfterThrowing]` right on your aspect methods, with a powerful regexp-like pointcut syntax (`execution(public App\Services\**->*(*))`).
- 🧩 **Laravel-native integration** — package auto-discovery, publishable config, aspects resolved through the container (constructor DI works), registration via a simple config list or the `goaop.aspect` service tag, `php artisan about` support.
- 🚀 **Production-friendly** — pre-generate all proxies at deploy time with `php artisan aop:warmup`; with `debug` off the woven code is served straight from cache and plays nicely with opcache.
- 🔬 **Pure PHP, no magic runtime** — built on Go! AOP 4.x: no PECL extensions, no `eval()`, all transformations produce reviewable static PHP files.
- ✅ **Proven by tests** — the bridge ships with end-to-end weaving tests (advice execution, `Around` return rewriting, cache generation) running against Laravel 12 and 13 on PHP 8.4.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.4
- Laravel 12 or 13
- goaop/framework 4.x (attribute-based aspects)

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

[](#installation)

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

The service provider is registered automatically via package discovery.

> **Note**Until goaop/framework 4.0 is tagged, the bridge depends on the unreleased `4.0-dev` line, so your application's `composer.json` needs:
>
> ```
> "minimum-stability": "dev",
> "prefer-stable": true
> ```

Publish the configuration if you want to tweak it:

```
php artisan vendor:publish --tag=goaop-config
```

Defining an aspect
------------------

[](#defining-an-aspect)

Aspects are plain classes implementing `Go\Aop\Aspect` whose advice methods are declared with PHP 8 attributes (`#[Before]`, `#[After]`, `#[Around]`, `#[AfterThrowing]`):

```
