Download the PHP package ytake/laravel-aspect without Composer
On this page you can find all versions of the php package ytake/laravel-aspect. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-aspect
Laravel-Aspect
aspect-oriented programming Package for laravel framework
This library is heavily inspired by the jcabi/jcabi-aspects.
usage
Laravel version Compatibility
| Laravel | Package |
|---|---|
| 5.0.x | 1.x |
| 5.1.x | 1.x |
| 5.2.x | 1.x |
| 5.3.x | 1.x |
| 5.4.x | 1.x |
| 5.5.x | 2.0.* |
| 5.6.x | 2.1.* |
| 5.7.x | 3.0.* |
| 6.0.x | 4.0 |
| 7.x | 6.0 |
| 8.x | 7.0 |
| 9.x | 8.0 |
| 10.x | 9.0 |
install
Supported Auto-Discovery(^Laravel5.5)
for Laravel9
Laravel-Aspect Supported Laravel5.6
added serviceProvider
for Lumen
Add App\Providers\LumenAspectServiceProvider to your bootstrap/app.php file.
publish aspect module class
more command options [--help]
publish configure
-
basic
-
use tag option
- use provider
register aspect module
config/ytake-laravel-aop.php
use classes property
example
notice
- Must use a service container
- Classes must be non-final
- Methods must be public
for Lumen
override Ytake\LaravelAspect\AspectServiceProvider
bootstrap/app.php
Cache Clear Command
PreCompile Command
Annotations
@Transactional
for database transaction(illuminate/database)
you must use the TransactionalModule
- option
| params | description |
|---|---|
| value (or array) | database connection |
| expect | expect exception |
Multiple Transaction
@Cacheable
for cache(illuminate/cache)
you must use the CacheableModule
- option
| params | description |
|---|---|
| key | cache key |
| cacheName | cache name(merge cache key) |
| driver | Accessing Cache Driver(store) |
| lifetime | cache lifetime (default: 120min) |
| tags | Storing Tagged Cache Items |
| negative(bool) | for null value (default: false) |
@CacheEvict
for cache(illuminate/cache) / remove cache
you must use the CacheEvictModule
- option
| params | description |
|---|---|
| key | cache key |
| cacheName | cache name(merge cache key) |
| driver | Accessing Cache Driver(store) |
| tags | Storing Tagged Cache Items |
| allEntries | flush(default:false) |
@CachePut
for cache(illuminate/cache) / cache put
you must use the CachePutModule
- option
| params | description |
|---|---|
| key | cache key |
| cacheName | cache name(merge cache key) |
| driver | Accessing Cache Driver(store) |
| lifetime | cache lifetime (default: 120min) |
| tags | Storing Tagged Cache Items |
@Loggable / @LogExceptions
for logger(illuminate/log, monolog)
you must use the LoggableModule / LogExceptionsModule
- option
| params | description |
|---|---|
| value | log level (default: Level::Info->value). Supports integer constants, Monolog Level enum values, or string level names ("debug", "info", etc.) |
| skipResult | method result output to log |
| name | log name prefix(default: Loggable) |
| driver | logger driver or channel name docs |
sample)
About @LogExceptions
Also, take a look at @Loggable. This annotation does the same, but also logs non-exceptional situations.
About @QueryLog
for database query logger(illuminate/log, monolog, illuminate/database)
@RetryOnFailure
Retry the method in case of exception.
you must use the RetryOnFailureModule.
- option
| params | description |
|---|---|
| attempts (int) | How many times to retry. (default: 0) |
| delay (int) | Delay between attempts. (default: 0 / sleep(0) ) |
| types (array) | When to retry (in case of what exception types). (default: <\Exception::class> ) |
| ignore (string) | Exception types to ignore. (default: \Exception ) |
@MessageDriven
Annotation for a Message Queue(illuminate/queue. illuminate/bus).
you must use the MessageDrivenModule.
- option
| params | description |
|---|---|
| value (Delayed) | \Ytake\LaravelAspect\Annotation\LazyQueue or \Ytake\LaravelAspect\Annotation\EagerQueue (default: EagerQueue) |
| onQueue (string) | To specify the queue. (default: null) ) |
| mappedName (string) | queue connection. (default: null/ default queue driver) |
LazyQueue
Handle Class Ytake\LaravelAspect\Queue\LazyMessage
EagerQueue
Handle Class Ytake\LaravelAspect\Queue\EagerMessage
Ignore Annotations
use config/ytake-laravel-aspect.php file
default: LaravelCollective/annotations
Append Custom Annotations
for testing
use none driver
All versions of laravel-aspect with dependencies
illuminate/console Version ^12.0
illuminate/filesystem Version ^12.0
illuminate/support Version ^12.0
illuminate/config Version ^12.0
illuminate/contracts Version ^12.0
illuminate/log Version ^12.0
illuminate/database Version ^12.0
illuminate/cache Version ^12.0
illuminate/events Version ^12.0
illuminate/bus Version ^12.0
illuminate/queue Version ^12.0
ray/aop Version ^2.9 <2.19.0
doctrine/annotations Version ^1.10
nikic/php-parser Version ^5.0
psr/log Version ^1.0.1 || ^2.0 || ^3.0