The namespace should map to the directory if the project is using PSR-4 autoloading.
So, App\Http\Controllers\SiteWeb class would be located in app/Http/Controllers directory.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi everyone ,
I'm new to laravel & I totally enjoy it . I recently joined a project (project is base on laravel 6) , the project works totally fine on my coworkers computers, my problem is that when i clone it and launch it , i get a :
Illuminate \ Contracts \ Container \ BindingResolutionException
Target class [App\Http\Controllers\SiteWeb] does not exist.
exemple of a route :
Route::get('', 'SiteWeb@index')->name('welcome');
The controller itself is in a folder :
App/Controllers/Api/Website
Namespace in the controller seems ok :
namespace App\Http\Controllers;
I tried without effect:
composer dump-autoload
php artisan config:cache
php artisan cache:clear
....
I had a look through many post / discussion but i can't find any appropriate solution, Any help would be really appreciated :) Thanks in advance !
I've found the issue ,
it was the version of composer which made the error, i was on 2.* and i downgraded to 1.6* , which is i think, the one use for the original project.
Please or to participate in this conversation.