问题描述
auth.php
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_resets',
'expire' => 60,
'throttle' => 60,
],
'admins'=>[
'providers'=>'admins',
'table'=>'password_resets',
'expire'=>60,
'throttle'=>60,
],
],
AdminForgotPasswordController.php
AdminForgotPasswordController.php
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
use Illuminate\Support\Facades\Password;
class AdminForgotPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset emails and
| includes a trait which assists in sending these notifications from
| your application to your users. Feel free to explore this trait.
|
*/
use SendsPasswordResetEmails;
public function __construct(){
$this->middleware('guest:admin');
}
/**
* Display the form to request a password reset link.
*
* @return \Illuminate\Http\Response
*/
public function showLinkRequestForm()
{
return view('auth.passwords.admin-email');
}
/**
* Get the broker to be used during password reset.
*
* @return \Illuminate\Contracts\Auth\PasswordBroker
*/
public function broker()
{
return Password::broker('admins');
}
}
问题是我正在制作multiauth miniproject,我在用户端和管理员端都编写了所有正确的代码...在用户端工作正常,重置密码通知工作正常,但是当我进入管理面板并单击忘记密码"时,它将显示我填写电子邮件表格,我发送电子邮件并发送重置链接,然后出现此错误,这是任何人都知道的问题,将是感激的.
problem is that i am making multiauth miniproject i code everything correct at user side and admin side...at user side is working well reset password notification is working well but when i go on admin panel and click on forgot password it shows me form to put email ,i put email and send reset link then this error appears what is problem anyone can know about that will be thankful.
推荐答案
我找到了解决方案.问题出在auth.php文件夹中,我使用的是提供程序而不是提供程序,因此出现此错误.只需检查config/auth.php并替换此代码即可.
i found it solution.. Problem was in auth.php folder i was using providers instead of provider so this error appears. just check config/auth.php and replace this code.
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_resets',
'expire' => 60,
'throttle' => 60,
],
'admins'=>[
'provider'=>'admins',
'table'=>'password_resets',
'expire'=>60,
'throttle'=>60,
],
],
这篇关于传递给Illuminate \ Auth \ Passwords \ PasswordBroker :: __ construct()的参数2必须实现接口Illuminate \ Contracts \ Auth \ UserProvider,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!