Unresolvable dependency resolving [Parameter #0 [ $request ]] in class Illuminate\Http\Client\Request
Esta mensagem aparece no postman ao tentar incluir alguma serie.
Arquivos:
seriecontroller
<?php
namespace App\Http\Controllers;
use App\Serie;
use Illuminate\Http\Client\Request;
class SeriesController
{
public function index(){
return Serie::all();
}
public function store(Request $request)
{
return response()
->json(
Serie::create($request->all()),
201
);
}
}
web.php
<?php
/** @var \Laravel\Lumen\Routing\Router $router */
$router->get('/', function () use ($router) {
return $router->app->version();
});
//todas as rotas irao comer com o /api
$router->group(['prefix' => 'api'], function () use ($router){
$router->get('series', 'SeriesController@index');
$router->post('series', 'SeriesController@store');
});