diff --git a/app/Console/Commands/UpdateWebmentionsRelationship.php b/app/Console/Commands/UpdateWebmentionsRelationship.php new file mode 100644 index 00000000..f5bc1114 --- /dev/null +++ b/app/Console/Commands/UpdateWebmentionsRelationship.php @@ -0,0 +1,36 @@ +where('commentable_type', '=', 'App\Model\Note') + ->update(['commentable_type' => Note::class]); + + $this->info('All webmentions updated to relate to the correct note model class'); + } +} diff --git a/app/Jobs/ProcessWebMention.php b/app/Jobs/ProcessWebMention.php index 6aacf29d..457ab71d 100644 --- a/app/Jobs/ProcessWebMention.php +++ b/app/Jobs/ProcessWebMention.php @@ -92,7 +92,7 @@ class ProcessWebMention implements ShouldQueue $webmention->source = $this->source; $webmention->target = $this->note->longurl; $webmention->commentable_id = $this->note->id; - $webmention->commentable_type = 'App\Model\Note'; + $webmention->commentable_type = Note::class; $webmention->type = $type; $webmention->mf2 = json_encode($microformats); $webmention->save();