web.php seems to be okay however, BindingResolutionException Target class [App\Http\Controllers\App\Stack\Http\Controllers\HomeController] does not exist.
error happens.
Where should fix it?
web.php
Route::get('/home', 'App\Stack\Http\Controllers\HomeController@index')->name('home');
HomeController.php
<?php
namespace App\Stack\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Stack\Http\Middleware\SetDefaultLayoutForUrls;
use Illuminate\Http\Request;
class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware(['auth', SetDefaultLayoutForUrls::class]);
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index()
{
return view('home');
}
the file is located at {thisProject}/app/Http/Controllers