1
0
mirror of https://github.com/flarum/core.git synced 2025-07-30 13:10:24 +02:00

Fix relationship method arguments

As per https://laravel.com/docs/5.5/upgrade (under "Eloquent")
This commit is contained in:
Toby Zerner
2017-12-26 20:21:47 +10:30
parent c145121516
commit 2d9839ee66

View File

@@ -59,15 +59,15 @@ class AddPostMentionedByRelationship
public function getModelRelationship(GetModelRelationship $event)
{
if ($event->isRelationship(Post::class, 'mentionedBy')) {
return $event->model->belongsToMany(Post::class, 'mentions_posts', 'mentions_id', 'post_id', 'mentionedBy');
return $event->model->belongsToMany(Post::class, 'mentions_posts', 'mentions_id', 'post_id', null, null, 'mentionedBy');
}
if ($event->isRelationship(Post::class, 'mentionsPosts')) {
return $event->model->belongsToMany(Post::class, 'mentions_posts', 'post_id', 'mentions_id', 'mentionsPosts');
return $event->model->belongsToMany(Post::class, 'mentions_posts', 'post_id', 'mentions_id', null, null, 'mentionsPosts');
}
if ($event->isRelationship(Post::class, 'mentionsUsers')) {
return $event->model->belongsToMany(User::class, 'mentions_users', 'post_id', 'mentions_id', 'mentionsUsers');
return $event->model->belongsToMany(User::class, 'mentions_users', 'post_id', 'mentions_id', null, null, 'mentionsUsers');
}
}