环境
- PHP 7.0+
- Laravel 5.1+ or Lumen 5.1+
composer加载
composer require flugger/laravel-responder
Laravel
在laravel的config/app.php中的providers添加
Flugg\Responder\ResponderServiceProvider::class,
alias中添加
'Responder' => Flugg\Responder\Facades\Responder::class,
'Transformation' => Flugg\Responder\Facades\Transformation::class,
然后
php artisan vendor:publish --provider="Flugg\Responder\ResponderServiceProvider"
使用
public function index(Responder $responder)
{
return $responder->success();
}
网友评论