hermansusandy
hermansusandy

Reputation: 51

BadMethodCallException: Method Illuminate\Routing\Route::get does not exist

I'd start a new laravel project, and want to make a controller called ProductController using Artisan, but it ends up with an error

“BadMethodCallException : Method Illuminate\Routing\Route::get does not exist.“

I'm using laravel 6.0

routes:

Route::get('/products', 'ProductController@index');

Command used:

php artisan make:controller ProductController

Upvotes: 3

Views: 7538

Answers (2)

user3008307
user3008307

Reputation: 1

you maybe use
href="{{route('--')}}" instead of href="{{url('---')}}" for routing in your blade , just change it to href="{{url('---')}}"

Upvotes: 0

Salim Djerbouh
Salim Djerbouh

Reputation: 11044

Import the Route facade instead of Illuminate\Routing\Route

use Illuminate\Support\Facades\Route;

Upvotes: 4

Related Questions