Here is my controller:
CASE - 1
We can change in api.php
and in web.php
files like bellow..
The current way we write syntex
is
Route::get('login', 'LoginController@login');
should changed to
Route::get('login', [LoginController::class, 'login']);
CASE - 2
app > Providers > RouteServiceProvider.php
protected $namespace = null;
with protected $namespace = 'App\Http\Controllers';
->namespace($this->namespace)
as shown in image..