1
0
mirror of https://github.com/flarum/core.git synced 2025-08-19 14:51:47 +02:00

Database changes (#16)

* Add foreign keys

* Rename table

* Use whereColumn

* Update core attribute names
This commit is contained in:
Toby Zerner
2018-09-17 04:19:51 +09:30
committed by Franz Liedke
parent 7526b70cf5
commit 74fac8c206
5 changed files with 57 additions and 3 deletions

View File

@@ -42,7 +42,7 @@ class AddPostLikesRelationship
public function getModelRelationship(GetModelRelationship $event)
{
if ($event->isRelationship(Post::class, 'likes')) {
return $event->model->belongsToMany(User::class, 'posts_likes', 'post_id', 'user_id', null, null, 'likes');
return $event->model->belongsToMany(User::class, 'post_likes', 'post_id', 'user_id', null, null, 'likes');
}
}

View File

@@ -48,7 +48,7 @@ class PostLikedBlueprint implements BlueprintInterface
/**
* {@inheritdoc}
*/
public function getSender()
public function getFromUser()
{
return $this->user;
}