Laravel 简单路由器 controller@action 得到 NotFoundHttpException 错误

Laravel simple router controller@action get NotFoundHttpException Error

下面的代码是我使用控制器操作的简单途径:

Route::get('/CheckCustomerTransactionPayment', 'PaymentTransactionController@check');

这是我的控制器class:

namespace App\Http\Controllers;

use App\CustomerTransactions;
use Illuminate\Http\Request;
use App\Http\Requests;
use Illuminate\Support\Facades\Log;
use Payment\Payment;

class PaymentTransactionController extends Controller
{
    public function check(Request $request)
    {
        dd($request->all());
    }
}

我收到这个错误:

NotFoundHttpException in RouteCollection.php line 161:

URL 检查:

http://localhost/project/public/CheckCustomerTransactionPayment/112323

如果你有这样定义的路线:

Route::get('/CheckCustomerTransactionPayment', 'PaymentTransactionController@check');

你应该打电话给 url

http://localhost/project/CheckCustomerTransactionPayment/

如果你想在 URL 中传递付款 ID,你需要这样定义你的路由:

Route::get('/CheckCustomerTransactionPayment/{id}', 'PaymentTransactionController@check');