dps123456789 2019-06-25 20:11
浏览 90
已采纳

错误类App \ Http \ Controllers \ ResetPasswordController不存在

I am trying to add a route for showing a form for resetting password.

I've added this the following definition into my route file.

<?php
Route::get( '/forgot-password', 'ResetPasswordController@showResetForm' )->name('password.forgot');

In my blade template I created a link to this route like that:

<a href='{{ route('password.forgot') }}'>{{__("auth.forgot.title")}}</a>

However when I click on the link I get the error:

Class App\Http\Controllers\ResetPasswordController does not exist

What am I doing wrong?

Laravel 5.8, php 7.2

  • 写回答

2条回答 默认 最新

  • drqxfmfa804578 2019-06-25 20:18
    关注

    It seems that you are trying to use the default ResetPasswordController controller. In that case, it has App\Http\Controllers\Auth namespace. As a result, you need to change the route definition in the following way:

    Route::get( '/forgot-password', 'Auth\ResetPasswordController@showResetForm' )->name('password.forgot');
    

    This should resolve the issue.

    P.S.

    From the route path forgot-password it seems that you have to use another controller ForgotPasswordController. Please check this.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探