在Laravel中,我收到以下错误,
(1/1) ReflectionException
Class App\Http\Controllers\amazonApi does not exist
AmazonController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class AmazonController extends Controller
{
public function amazonApi() {
$product = Amazon::lookup('B004VLKY8M')->json();
dd($product);
}
}
web.php
Route::get('/', function () {
return view('welcome');
});
Route::get('/api','amazonApi@AmazonController');
有人可以帮忙吗?
答案 0 :(得分:1)
将路线更改为:
Route::get('/api', 'AmazonController@amazonApi');