doushan3511 2015-09-21 13:41
浏览 39
已采纳

密码重置链接不起作用Laravel-5

I am using password reset functionality using laravel-5.My problem is when i got reset link on mail and than i click that link reset page not open the page show error.

error-

 ReflectionException in Container.php line 736:
Class App\Http\Controllers\Auth/PasswordController does not exist

route.php-

Route::get('/password/reset/{token}', 'Auth/PasswordController@getReset');
Route::post('/password/reset', 'Auth/PasswordController@postReset');

passwordcontroller.php

<?php namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Auth\PasswordBroker;
use Illuminate\Foundation\Auth\ResetsPasswords;



use App\User;
use Validator;


use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;



class PasswordController extends Controller {

    /*
    |--------------------------------------------------------------------------
    | Password Reset Controller
    |--------------------------------------------------------------------------
    |
    | This controller is responsible for handling password reset requests
    | and uses a simple trait to include this behavior. You're free to
    | explore this trait and override any methods you wish to tweak.
    |
    */

    use ResetsPasswords;

    /**
     * Create a new password controller instance.
     *
     * @param  \Illuminate\Contracts\Auth\Guard  $auth
     * @param  \Illuminate\Contracts\Auth\PasswordBroker  $passwords
     * @return void
     */

    protect $redirectTo ='/library';
    public function __construct(Guard $auth, PasswordBroker $passwords)
    {
        $this->auth = $auth;
        $this->passwords = $passwords;

        $this->middleware('guest');
    }

}

password.blade.php

<h1>Click on this--- </h1> {{ url('/password/reset/'.$token) }}

Please help-

  • 写回答

1条回答 默认 最新

  • douweng9427 2016-01-05 06:29
    关注

    the Problem is your route. change '/' to '\'

    Route::get('/password/reset/{token}', 'Auth\PasswordController@getReset');
    Route::post('/password/reset', 'Auth\PasswordController@postReset');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?