jeudi 27 octobre 2016

ReflectionException in Route.php line 333: Method App\Http\Controllers\DbImportController::csv() does not exist

I am using Laravel 5.2 and facing strange behavior at local and server. The below code working fine in Local where as not working in server.

In controller newly added method is not working, even updating the existing method also not working.

Routing code

routes\web.php code as below

Route::get('dbimport/','DbImportController@index');
Route::get('dbimport/test','DbImportController@test');

DbImportController code

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';
    }
}

The above code is working fine and the methods also working fine, but today I added new method which is called csv and updated test method content.

Updated code as follows

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');
    }
}

And routes/web.php

Route::get('dbimport/','DbImportController@index');
Route::get('dbimport/test','DbImportController@test');
Route::get('dbimport/csv','DbImportController@csv');

Now, if I run the test method it's showing old content as "This is a test method" not showing updated code.

If I run the new method dbimport/csv it's showing an error as below enter image description here

I run all the cache clear commans, php artisan config:clear, cache:clear, view:clear, route:clear. But no use.

Please help me, thanks in advance.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2eQ0upX
via IFTTT

1 commentaire:

  1. Hi, have you solved this issue? now i encountering same issue. Do you mind to share how did you solve the problem? Thanks in advanced

    RépondreSupprimer