mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 06:53:47 +08:00
Upgrade to Laravel 5.5
This commit is contained in:
parent
8b843a9eb3
commit
b4bc534028
|
@ -41,7 +41,7 @@ class AddDiscussionTagsRelationship
|
|||
public function getModelRelationship(GetModelRelationship $event)
|
||||
{
|
||||
if ($event->isRelationship(Discussion::class, 'tags')) {
|
||||
return $event->model->belongsToMany(Tag::class, 'discussions_tags', null, null, 'tags');
|
||||
return $event->model->belongsToMany(Tag::class, 'discussions_tags', null, null, null, null, 'tags');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ class CreatePostWhenTagsAreChanged
|
|||
$event->discussion->id,
|
||||
$event->actor->id,
|
||||
array_pluck($event->oldTags, 'id'),
|
||||
$event->discussion->tags()->lists('id')->all()
|
||||
$event->discussion->tags()->pluck('id')->all()
|
||||
);
|
||||
|
||||
$event->discussion->mergePost($post);
|
||||
|
|
|
@ -53,7 +53,7 @@ class FilterDiscussionListByTags
|
|||
$query->whereNotExists(function ($query) {
|
||||
return $query->select(new Expression(1))
|
||||
->from('discussions_tags')
|
||||
->whereIn('tag_id', Tag::where('is_hidden', 1)->lists('id'))
|
||||
->whereIn('tag_id', Tag::where('is_hidden', 1)->pluck('id'))
|
||||
->where('discussions.id', new Expression('discussion_id'));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ class SaveTagsToDatabase
|
|||
|
||||
if ($discussion->exists) {
|
||||
$oldTags = $discussion->tags()->get();
|
||||
$oldTagIds = $oldTags->lists('id')->all();
|
||||
$oldTagIds = $oldTags->pluck('id')->all();
|
||||
|
||||
if ($oldTagIds == $newTagIds) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue
Block a user