Llamada al método undefined IlluminateDatabaseQueryBuilder:: notify()


Problema en Laravel 5.3.6 cuando se envía una solicitud en Forgot Password.

Detalles del error

Llamada al método undefined Illuminate\Database \ Query \ Builder:: notify()

El problema está en el siguiente archivo:

Vendor \ laravel \ framework \ src \ Illuminate \ Auth \ PasswordBroker.php

Línea 69. El código está debajo

$user->sendPasswordResetNotification(
    $this->tokens->create($user)
);

Función: sendResetLink

Estaba funcionando bien en Laravel 5.2 y parece que no funciona en 5.3.6 versión. ¿Se ha enfrentado a este problema?

Author: Pankaj, 2016-09-06

3 answers

Debe agregar Illuminate\Notifications\Notifiable rasgo en el modelo User.

 47
Author: Bestmomo Momo,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-10-04 09:52:20
  1. Agregue el rasgo Notificable en su modo de usuario.

    Illuminate\Notifications\Notifiable

  2. Agrega esto en tu app.php:

Para sus proveedores:

Illuminate\Notifications\NotificationServiceProvider::class,

En los alias:

'Notification' => Illuminate\Support\Facades\Notification::class,

  1. Recuerde actualizar su configuración desdeen config/mail.archivo php .
 10
Author: Francisco Corrales Morales,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-03-08 15:12:13

En mi caso, todavía estaba recibiendo error después de seguir los pasos dados en otras respuestas.

BadMethodCallException: Llamada al método undefined Illuminate\Database \ Query \ Builder:: notify()

Me faltaba

Use Notificable

...
use Illuminate\Notifications\Notifiable;
class User extends Model
{
     use SoftDeletes, Notifiable;
     ...
 7
Author: Nijesh Hirpara,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-09-06 00:40:46