Answer the question
In order to leave comments, you need to log in
Why can't Laravel see the controller?
I follow the path site.ru/admin/currency
An error pops up: Class App\Http\Controllers\Admin\CurrencyController does not exist
Physically, the file exists in this folder.
Route (located in the routesAdmin.php file, next to routes.php):
Route::group(
[
'prefix' => 'admin',
'middleware' => ['auth']
],
function () {
Route::get('currency', [
'as' => 'admin.currency.index',
'uses' => 'Admin\[email protected]'
]);
});
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
class CurrencyController extends Controller
{
public function index()
{
return "ololo";
}
}
Answer the question
In order to leave comments, you need to log in
Namespace is incorrect, change it toApp\Http\Controllers\Admin
You can change the route
Route::get('currency', [
'as' => 'admin.currency.index',
'uses' => '[email protected]'
]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question