2017-01-30 21 views
1

,我發現了以下錯誤:ErrorException在UrlGenerator.php行605:行動應用程序\ HTTP \控制器\ VehicleController @ processLead沒有定義。沒有定義動作 - ErrorException在UrlGenerator.php線605

如果使用command php artisan route:list存在的路線我已經檢查和它的作用。

路線\ web.php

<?php 

use App\Http\Controllers\BaseController; 
use App\Http\Controllers\VehicleController; 
use App\Http\Requests\ValidateLeadValues; 
use Illuminate\Http\Request; 

/* 
|-------------------------------------------------------------------------- 
| Web Routes 
|-------------------------------------------------------------------------- 
| 
| This file is where you may define all of the routes that are handled 
| by your application. Just tell Laravel the URIs it should respond 
| to using a Closure or controller method. Build something great! 
| 
*/ 

Route::get('/', '[email protected]'); 
Route::get('usedcars/', '[email protected]'); 
Route::post('processLead/{id}', function ($id, ValidateLeadValues $leadValues, VehicleController $vehicleController) 
{ 
    return $vehicleController->processLead($id, $leadValues); 
})->where(['id' => '[0-9]+']); 

我有我的看法文件中的以下。代碼在我的表單中,當我刪除它時,頁面加載正常。

{{ action('[email protected]', ['id' => $vehicle->id]) }} 
+0

你有更新嗎?也許你在不同的庫上有錯誤的版本。 – Carles

+0

是的,我做了作曲家更新。更新之前一切正常,現在我收到了這個錯誤。 – VenomRush

回答

1

你有沒有在App \ HTTP \控制器\ VehicleController的公共方法processLead?

嘗試改變視圖{{URL( 'processLead',[$媒介物> ID])}}

我認爲出現該問題,因爲路線不與控制器方法直接登記。

+1

我知道你還沒有足夠的積分,但是隻要你能得到它們,你應該把它作爲評論,而不是回答。 – Carles

+0

是的,我有公共方法processLead()。更改action()到url()不起作用,因爲我猜laravel不知道哪個控制器用於url? – VenomRush

+0

如何使用控制器方法直接註冊路線?我是如何將它註冊到我的路線文件中的? – VenomRush

相關問題