11# Laravel-Aspect
2- for laravel framework(use Go!Aop Framework)
2+ for laravel framework
33
44[ ![ Build Status] ( http://img.shields.io/travis/ytake/Laravel-Aspect/master.svg?style=flat-square )] ( https://travis-ci.org/ytake/Laravel-Aspect )
55[ ![ Coverage Status] ( http://img.shields.io/coveralls/ytake/Laravel-Aspect/master.svg?style=flat-square )] ( https://coveralls.io/r/ytake/Laravel-Aspect?branch=master )
@@ -13,7 +13,7 @@ for laravel framework(use Go!Aop Framework)
1313[ ![ Latest Version] ( http://img.shields.io/packagist/v/ytake/laravel-aspect.svg?style=flat-square )] ( https://packagist.org/packages/ytake/laravel-aspect )
1414[ ![ Total Downloads] ( http://img.shields.io/packagist/dt/ytake/laravel-aspect.svg?style=flat-square )] ( https://packagist.org/packages/ytake/laravel-aspect )
1515
16- ## usage
16+ ## usage
1717
1818### install
1919
@@ -41,6 +41,33 @@ $ composer require ytake/laravel-aspect
4141]
4242```
4343
44+ ### publish aspect module class
45+
46+ ``` bash
47+ $ php artisan ytake:aspect-module-publish
48+ ```
49+ more command options [ --help]
50+
51+ ### aspect kernel boot
52+
53+ added serviceProvider Class
54+
55+ ``` php
56+ class AppServiceProvider extends ServiceProvider
57+ {
58+ /**
59+ * @return void
60+ */
61+ public function boot()
62+ {
63+ /** @var \Ytake\LaravelAspect\AspectManager $aspect */
64+ $aspect = $this->app['aspect.manager'];
65+ $aspect->register(\App\Modules\CacheableModule::class);
66+ }
67+
68+ }
69+ ```
70+
4471### publish configure
4572
4673* basic
@@ -69,7 +96,7 @@ $ php artisan ytake:aspect-clear-cache
6996
7097## Annotations
7198
72- ### @Transactional (Around Advice)
99+ ### @Transactional
73100for database transaction(illuminate/database)
74101
75102* option
@@ -90,7 +117,7 @@ public function save(array $params)
90117}
91118```
92119
93- ### @Cacheable (After Advice)
120+ ### @Cacheable
94121for cache(illuminate/cache)
95122
96123* option
@@ -118,7 +145,7 @@ public function namedMultipleKey($id, $value)
118145}
119146```
120147
121- ### @CacheEvict (After Advice)
148+ ### @CacheEvict
122149for cache(illuminate/cache) / remove cache
123150
124151* option
@@ -144,7 +171,7 @@ public function removeCache()
144171}
145172```
146173
147- ### @CachePut (After Advice)
174+ ### @CachePut
148175for cache(illuminate/cache) / cache put
149176
150177* option
@@ -169,23 +196,38 @@ public function throwExceptionCache()
169196}
170197```
171198
172- ## add Interceptors
199+ ### @Loggable
200+
201+ soon
173202
174- your service provider's
203+ ### Annotation Cache Driver
204+
205+ chose array driver or file cache driver
206+
207+ use config/ytake-laravel-aspect.php file
175208
176209``` php
177- public function boot()
178- {
179- $this->app['aspect.annotation.register']->registerAnnotations([
180- app_path() . '/Annotation/Finder.php',
181- ]);
182-
183- $this->app['aspect.manager']->setAspects([
184- \App\Interceptor\SampleInterceptor::class
185- ]);
186- }
210+ 'annotation' => [
211+ /**
212+ * choose annotation reader
213+ * 'array'(default), 'file'(file cache)
214+ */
215+ 'default' => env('ASPECT_ANNOTATION_DRIVER', 'array'),
216+
217+ 'drivers' => [
218+ 'file' => [
219+ 'cache_dir' => storage_path('framework/annotation'),
220+ //
221+ 'debug' => env('ASPECT_ANNOTATION_DEBUG', true),
222+ ],
223+ ],
224+ ],
187225```
188226
227+ ## add Interceptors
228+
229+ soon
230+
189231## for testing
190232use none driver
191233
0 commit comments