2016-10-27 49 views
0

我使用Laravel 5.2並面臨在本地和服務器的奇怪行爲。 下面的代碼工作正常在本地,因爲不在服務器工作。ReflectionException在Route.php 333行:方法App Http Controllers DbImportController :: csv()不存在

在控制器新添加的方法不起作用,甚至更新現有的方法也不起作用。

路由代碼

routes\web.php code as below 

Route::get('dbimport/','[email protected]'); 
Route::get('dbimport/test','DbImportContr[email protected]'); 

DbImportController代碼

app\Http\Controllers\DbImportController.php as below 

<?php 

namespace App\Http\Controllers; 

use App\Http\Controllers\Controller; 
use \Illuminate\Database\Connection; 
use \Illuminate\Http\Request; 
use App\Http\Requests; 

class DbImportController extends Controller 
{ 
    public function index() { 
     return view('dbimport'); 
    } 

    public function test() { 
     return 'This is a test method'; 
    } 
} 

上面的代碼工作正常和方法也工作正常,但今天我加入被稱爲CSV和更新的測試方法內容的新方法。

更新後的代碼如下

class DbImportController extends Controller 
{ 
    public function index() { 
     return view('dbimport'); 
    } 

    public function test() { 
     return 'This is a test method modified @ 27/10/2016'; 
    } 

    public function csv() { 
     return view('csvimport'); 
    } 
} 

和路線/ web.php

Route::get('dbimport/','[email protected]'); 
Route::get('dbimport/test','[email protected]'); 
Route::get('dbimport/csv','[email protected]'); 

現在,如果我運行的測試方法它顯示舊的內容爲「這是一個測試方法」不顯示更新的代碼。

如果我運行的新方法dbimport/CSV它的顯示如下 enter image description here

錯誤我運行下面所有的緩存明確commans,

php artisan config:clear 
php artisan cache:clear 
php artisan view:clear 
php artisan route:clear 

但是沒有用。

請幫助我,在此先感謝。

回答

相關問題