在Laravel上通知NDER 3.1无结果
我已经在我的laravel应用程序中安装了Notifynder 3.1,如果可以尝试,我只需插入一个通知:在Laravel上通知NDER 3.1无结果,laravel,notifications,Laravel,Notifications,我已经在我的laravel应用程序中安装了Notifynder 3.1,如果可以尝试,我只需插入一个通知: $from_user_id = 1; $to_user_id = 2; Notifynder::category('hello') ->from($from_user_id) ->to($to_user_id) ->url('http://www.yourwebsite.com/page') ->
$from_user_id = 1;
$to_user_id = 2;
Notifynder::category('hello')
->from($from_user_id)
->to($to_user_id)
->url('http://www.yourwebsite.com/page')
->send();
如果我检查数据库内部是否有通知,它工作正常
当我尝试以这种方式获取通知时,会出现问题:
$user = User::find(2);
dd($user->getNotifications($limit = 10, $paginate = 1, $order = 'desc'));
结果是:
结果为空,但存在数据库中的通知
有人能帮我吗 你能确认一下你的
应用程序/User.php中是否有这一点吗
:
use Fenos\Notifynder\Notifable;
class User extends Model
{
use Notifable;
}
我发现了问题,并解决了它。 如果更改了用户主键,则在vendor\fenos\notifynder\src\notifynder\notifiable.php中 将此
$this->id
更改为此$this->getKey()