My controller is not working when i am attaching router and controller with each other. It is showing the error
Class App\Http\Controllers\HelloController does not exist.
I hope my syntax and everything is right but can't figure out the issue.
Filename is also same as class name.
namespace I used is :
namespace App\Http\Controllers\;
Route code:
Route::get('sayHello', 'HelloController@index');
Controller Code:
class HelloController extends Controller
{
public function index()
{
return view('hello');
}
}
compuser dump-autoload
– Gohel Dhaval