From the lack of details I am guessing you are using the original controller routing syntax Route::get('/', 'MarketsouhaibController@index')
, the syntax we all have been using for a long time, and this is a common issue. This syntax worked till Laravel 7. From 8 they changed it.
From Laravel 8, a new syntax is introduced and is the new standard. You have two options now. You either use the String Syntax or PHP callable syntax as shown below.
//string syntax
Route::get('/', 'App\Http\Controllers\MarketsouhaibController@index')
//php callable syntax
use App\Http\Controllers\MarketsouhaibController; //must be placed at the top of routes
Route::get('/', [MarketsouhaibController::class, 'index']);
But if you still want to use the original auto-prefixed controller routing just follow the following steps.
- Navigate to your
RouteServiceProvider
- Add
protected $namespace = 'App\Http\Controllers';
A personal suggestion, before starting please read the documentations. There are there for a reason. The solution I posted is also available in the Documentation provided by Laravel and the Upgrade Guide they posted.