0
Em bị lỗi nay mọi người giúp em ạ
Class App\Http\Controllers\Auth\LoginController does not exist
Em bị lỗi này em đã php artisan make:auth
Đây là route của em ạ
Auth::routes();
Route::get('user/profile', '[email protected]')->name('user.profile');
Auth::routes();
Route::get('/home', '[email protected]')->name('home');
Auth::routes();
Route::get('/home', '[email protected]')->name('home');
Route::post('login', [ 'as' => 'login', 'uses' => '[email protected]']);
Add a comment
2 ANSWERS
+2
mặc định lúc bạn chạy câu lệnh php artisan make:auth
thì Laravel tự sinh cho bạn một class App\Http\Controllers\Auth\LoginController.php
và một Route::post('login', 'App\Http\Controllers\Auth\[email protected]')
rồi, mình k biết bạn tạo thêm cái
Route::post('login', [ 'as' => 'login', 'uses' => '[email protected]']);
để làm gì. Có thể nó đang bị trùng, bạn thử comment dòng cuối lại xem sao
+1
- Vì bạn đang make auth. LoginController nằm trong thư mục Auth nên khi bạn muốn định nghĩa 1 method nào phải
'uses' =>'Auth\[email protected]'
.
Ở đây cụ thể là Route::post('login', [ 'as' => 'login', 'uses' => '[email protected]']);
=> Route::post('login', [ 'as' => 'login', 'uses' => 'Auth\[email protected]'])
;
Với cả bạn đang duplicate 3 cái Auth::routes();
mà IDE không báo lỗi nhỉ :-?