Saturday, March 11, 2017

Method App\Http\Controllers\ProductController::getIndex()() does not exist

web.php file

this is my web.php file using laravel 5.4

<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', [

            'uses' =>'ProductController@getIndex()',
            'as' =>'product.index'

    ]);

ProductController.php

this is my controller file using laravel5.4

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class ProductController extends Controller
{
    //



    public function getIndex(){
        return view('shop.index');
    }
}

How to get rid of this error please help me.

What's wrong with it ?



via Riyas Randhava

Advertisement