I'm using Laravel-8 to develop my project, and I have a resource controller named ProductController which is placed at Admin directory inside Controllers, just like this image is showing:
Then at my route file, I coded this:
Route::resource('products', 'ProductController');
Route::resource('permissions', 'PermissionController');
But when I want to go to products route, I get this message:
Illuminate\Contracts\Container\BindingResolutionException Target class [App\Http\Controllers\Admin\ProductController] does not exist.
Now you may say in Laravel-8, I have to use Route::get('/', ProductController::class);, but as you can see above, I have also determined a permissions route to PermissionController by the old method and it is working completely fine!
The namespace of Admin is also specified at RouteServiceProvider:
Route::middleware(['web' , 'auth' , 'auth.admin'])
->namespace('App\Http\Controllers\Admin')
->prefix('admin')
->group(base_path('routes/web/admin.php'));
Note that I also tried Route::resource('products', ProductController::class); , but still get the same error.
I guess the issue is coming from another part!
So if you have any idea about this, please let me know, I would really appreciate any idea or suggestion from you guys...
Thanks in advance.
UPDATE #1:
ProductController goes like this:
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\Product;

ProductControlleris not found. I tried the both old and new ways to call this Controller, but still can not be found.UPDATE #1plz