如何在Laravel 8中使用Web路由为Auth Controller
我想使用多步注册。但是在路线上遇到了麻烦。这是我的第一个路线。
Route::get('register-step2', [Auth\RegisterStep2Controller::class,'showForm']);
Route::post('register-step2', [Auth\RegisterStep2Controller::class, 'postForm'])
->name('register.step2');
但是它获得了错误
目标类[auth \ registhstep2controller]。
因此,我更改并与此代码混合。
Route::group(['middleware' => ['auth']], function() {
Route::resource('roles', RoleController::class);
Route::resource('users', UserController::class);
Route::resource('products', ProductController::class);
Route::get('register-step2', [RegisterStep2Controller::class,'showForm']);
Route::post('register-step2', [RegisterStep2Controller::class, 'postForm'])
->name('register.step2');
但是它说:目标类[registerStep2Controller]不存在。
如何在Laravel 8或9中的AUTH中使用控制器。
我想在Auth文件夹中使用registerstep2控制器。
I wanted to use multi step registration. But got trouble at route. This is my first route.
Route::get('register-step2', [Auth\RegisterStep2Controller::class,'showForm']);
Route::post('register-step2', [Auth\RegisterStep2Controller::class, 'postForm'])
->name('register.step2');
but it got error
Target class [Auth\RegisterStep2Controller] does not exist.
so I change and mix with this code.
Route::group(['middleware' => ['auth']], function() {
Route::resource('roles', RoleController::class);
Route::resource('users', UserController::class);
Route::resource('products', ProductController::class);
Route::get('register-step2', [RegisterStep2Controller::class,'showForm']);
Route::post('register-step2', [RegisterStep2Controller::class, 'postForm'])
->name('register.step2');
But it says that: Target class [RegisterStep2Controller] does not exist.
How to use controller in auth in laravel 8 or 9.
I wanted to use registerstep2 controller in auth folder.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据下面的
Make changes in your
routes/web.php
as per below