zhwei/laravel-autowire
Composer 安装命令:
composer require zhwei/laravel-autowire
包简介
Laravel Autowire Kit
README 文档
README
Usage
- Composer
composer require zhwei/laravel-autowire
- Register Service Provider (Lumen only)
$app->register(\Zhwei\LaravelAutowire\AutowireServiceProvider::class);
- Autowire
Any class implemented the Zhwei\LaravelAutowire\AutowireAble interface will trigger auto-wire after container resolution.
class HelloController implements Zhwei\LaravelAutowire\AutowireAble { /** * @autowire * @var \Illuminate\Contracts\Cache\Factory */ protected $cache; public function hello() { return $this->cache->store()->get('hello'); } }
or trigger by your self:
$hello = new HelloController(); Zhwei\LaravelAutowire\AutowireInjector::inject(app(), $hello);
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-08-22