Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Framework Laravel Package

goaop/framework

Go! AOP brings aspect-oriented programming to PHP without extensions or eval. Define aspects once to apply logging, caching, security and other cross-cutting concerns across your app automatically, keeping business code clean with static file weaving.

View on GitHub
Deep Wiki
Context7

:gem: Go! AOP PHP - modern aspect-oriented framework for the new level of software development

Frequently asked questions about Framework
How does Go! AOP integrate with Laravel’s middleware stack? Can I use aspects alongside middleware?
Go! AOP works alongside Laravel middleware but serves different purposes. Middleware handles HTTP-level concerns (e.g., auth, CSRF), while aspects target cross-cutting logic like logging method execution or caching results. You can use both, but avoid overlapping logic. For example, use aspects for internal service calls and middleware for HTTP requests. The package doesn’t conflict with Laravel’s service container, so you can bind aspects like any other service.
Does Go! AOP support Laravel’s Eloquent ORM or database queries?
Yes, Go! AOP can intercept Eloquent queries or repository methods by applying aspects to model classes or query builder methods. For example, you can log all database queries by annotating model methods with `@LogExecutionTime`. The package doesn’t modify Eloquent directly but works transparently with any PHP class, including Eloquent models. Just ensure your aspects are bound in Laravel’s service container.
What’s the performance impact of using Go! AOP in production?
Go! AOP introduces minimal overhead because it uses static file weaving (no runtime `eval` or dynamic code generation). Benchmarks show aspect execution adds ~5-15ms per intercepted method, depending on complexity. For high-traffic apps, profile aspects like logging or caching to ensure they don’t bottleneck critical paths. The framework is optimized for large applications, so performance is predictable and stable.
Can I use Go! AOP with Laravel’s queues or job processing?
Absolutely. Apply aspects to job classes or queue handlers to log execution, retry failed jobs, or cache results. For example, annotate a `DispatchJobs` method with `@RetryOnFailure` to automatically handle job retries. The package works with Laravel’s queue system as long as your aspects are bound in the container and target the relevant classes/methods.
How do I migrate from Laravel middleware to Go! AOP for cross-cutting concerns?
Start by identifying repetitive middleware logic (e.g., logging, caching) and refactor it into reusable aspects. For example, replace a `LogRequestsMiddleware` with a `@LogExecutionTime` aspect applied to controller methods. Test aspects incrementally in non-critical modules first. Use Laravel’s service container to bind aspects alongside middleware, ensuring no conflicts. The package provides migration guides in its docs for common use cases.
Does Go! AOP work with Laravel’s API resources or serializers?
Yes, you can apply aspects to API resource methods or serializers to log data transformations, validate responses, or cache serialized output. For example, use `@CacheResponse` on a `toArray()` method to cache API responses. The package treats all PHP classes equally, so it works with Laravel’s API layer as long as you target the right methods. Just ensure your aspects are bound in the container.
What Laravel versions does Go! AOP support, and are there breaking changes in v3.x?
Go! AOP supports Laravel 9+ and PHP 8.1+. The v3.x branch is backward-compatible with existing integrations, but always check the [changelog](https://github.com/goaop/framework/releases) for minor updates. If you’re using custom aspect logic or weaving strategies, verify they still work post-update. The package avoids breaking changes but may deprecate features in future major releases (e.g., v4.x).
How do I test aspects in Laravel’s PHPUnit tests? Can I mock aspect behavior?
Test aspects like any other Laravel service. Use PHPUnit’s dependency injection to mock `AspectInterface` or specific aspect classes. For example, replace a `LoggingAspect` with a mock in your tests to verify method calls. The package supports standard Laravel testing patterns, including service container bindings. Avoid testing internal weaving logic—focus on behavior changes (e.g., ‘Does `@LogExecutionTime` fire when expected?’).
Are there alternatives to Go! AOP for Laravel, and why should I choose this package?
Alternatives include PECL extensions like `php-aop` or runtime-based tools like `uopz`, but Go! AOP stands out for its **zero dependencies**, **no `eval`**, and **static file weaving**—critical for security and auditing. Unlike extensions, it works anywhere PHP runs (shared hosting, Docker, etc.). It’s also Laravel-native, integrating seamlessly with the service container, events, and attributes. If you need a production-ready, type-safe AOP solution without extensions, Go! AOP is the best choice.
How do I debug issues with aspects not firing in Laravel?
First, verify your aspect is bound in Laravel’s service container. Check for typos in annotations (e.g., `@LogExecutionTime` vs. `@logExecutionTime`). Use `php artisan config:clear` and restart your server if aspects were recently added. Enable debug logging in your aspect class to trace execution. The package includes a `@DebugAspect` annotation to log weaving details. If using compile-time weaving, ensure generated files are included in your autoloader.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
yandex/translate-api
voku/simple_html_dom
league/flysystem-vfs
bkwld/upchuck
filament/spatie-laravel-tags-plugin
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php