Password::broker PHP Method

broker() public static method

Attempt to get the broker from the local cache.
public static broker ( string $name = null ) : Illuminate\Contracts\Auth\PasswordBroker
$name string
return Illuminate\Contracts\Auth\PasswordBroker
        public static function broker($name = null)
        {
            return \Illuminate\Auth\Passwords\PasswordBrokerManager::broker($name);
        }

Usage Example

 public function sendResetLinkEmail(Request $request)
 {
     $this->validate($request, ['email' => 'required|email']);
     $broker = $this->getBroker();
     $response = Password::broker($broker)->sendResetLink($request->only('email'), function (Message $message) {
         $message->subject($this->getEmailSubject());
     });
     switch ($response) {
         case Password::RESET_LINK_SENT:
             return $this->getSendResetLinkEmailSuccessResponse($response);
         case Password::INVALID_USER:
         default:
             return $this->getSendResetLinkEmailFailureResponse($response);
     }
 }
All Usage Examples Of Password::broker