-1

Route/web.php

Route::get('/', 'HomeController@index'); 

enter image description here

issue in the attached picture occurs.

It's laravel 8.x.

2
  • Route::get('/', [App\Http\Controller\HomeController::class, index]); it's working, i guess. Commented Feb 9, 2021 at 3:26
  • oh, thx. it's solution for me. Commented Feb 9, 2021 at 3:44

1 Answer 1

1

Import the class in the top. I think you forget this.

use app\Http\Controllers\HomeController; 

and then,

Route::get('/', [HomeController::class,'index'); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.