mirror of
https://github.com/flarum/core.git
synced 2025-10-18 10:16:09 +02:00
Fix notifications
This commit is contained in:
@@ -6,8 +6,6 @@ use Flarum\Core\Support\DispatchesEvents;
|
||||
|
||||
class ReadNotificationHandler
|
||||
{
|
||||
use DispatchesEvents;
|
||||
|
||||
/**
|
||||
* @param ReadNotification $command
|
||||
* @return Notification
|
||||
@@ -26,8 +24,6 @@ class ReadNotificationHandler
|
||||
$notification->read();
|
||||
$notification->save();
|
||||
|
||||
$this->dispatchEventsFor($notification);
|
||||
|
||||
return $notification;
|
||||
}
|
||||
}
|
||||
|
@@ -54,6 +54,6 @@ class DiscussionRenamedBlueprint implements Blueprint
|
||||
*/
|
||||
public static function getSubjectModel()
|
||||
{
|
||||
return 'Flarum\Core\Models\Discussion';
|
||||
return 'Flarum\Core\Discussions\Discussion';
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php namespace Flarum\Core\Notifications;
|
||||
|
||||
use Flarum\Core\Model;
|
||||
use Flarum\Core\Support\MappedMorphToTrait;
|
||||
|
||||
/**
|
||||
* Models a notification record in the database.
|
||||
@@ -20,6 +21,8 @@ use Flarum\Core\Model;
|
||||
*/
|
||||
class Notification extends Model
|
||||
{
|
||||
use MappedMorphToTrait;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@@ -111,7 +114,7 @@ class Notification extends Model
|
||||
*/
|
||||
public function subject()
|
||||
{
|
||||
return $this->morphTo('subject', 'subjectModel', 'subject_id');
|
||||
return $this->mappedMorphTo(static::$subjectModels, 'subject', 'type', 'subject_id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user