2
你好,我是使用实施laravel 5.2密钥验证这个package使用API后卫Laravel 5.2
它给我一个错误
ErrorException in ApiGuardAuth.php line 14:
Argument 1 passed to Chrisbjr\ApiGuard\ApiGuardAuth::__construct() must be an instance of Chrisbjr\ApiGuard\Contracts\Providers\Auth, null given, called in E:\xammp\htdocs\vox\didww\vendor\chrisbjr\api-guard\src\Providers\ApiGuardServiceProvider.php on line 49 and defined
这里是我的控制器
<?php
namespace App\Http\Controllers;
use Chrisbjr\ApiGuard\Models;
use Chrisbjr\ApiGuard\Http\Controllers\ApiGuardController;
class BooksController extends ApiGuardController
{
public function all()
{
return "die";
$books = \App\User::all();
return $this->response->withCollection($books, new BookTransformer);
}
public function show($id)
{
try {
$book = \App\User::findOrFail($id);
return $this->response->withItem($book, new BookTransformer);
} catch (ModelNotFoundException $e) {
return $this->response->errorNotFound();
}
}
}
我也更新了app.php和kernal.php 有什么建议吗?
P.S对不起我的英文不好
我也跟着这个[link](https://blog.muya.co.ke/api-guard-laravel-5-2/) –