mirror of
https://github.com/flarum/core.git
synced 2025-08-21 15:52:44 +02:00
Upgrade to Laravel 5.5
This commit is contained in:
@@ -41,7 +41,7 @@ class AddDiscussionTagsRelationship
|
|||||||
public function getModelRelationship(GetModelRelationship $event)
|
public function getModelRelationship(GetModelRelationship $event)
|
||||||
{
|
{
|
||||||
if ($event->isRelationship(Discussion::class, 'tags')) {
|
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->discussion->id,
|
||||||
$event->actor->id,
|
$event->actor->id,
|
||||||
array_pluck($event->oldTags, 'id'),
|
array_pluck($event->oldTags, 'id'),
|
||||||
$event->discussion->tags()->lists('id')->all()
|
$event->discussion->tags()->pluck('id')->all()
|
||||||
);
|
);
|
||||||
|
|
||||||
$event->discussion->mergePost($post);
|
$event->discussion->mergePost($post);
|
||||||
|
@@ -53,7 +53,7 @@ class FilterDiscussionListByTags
|
|||||||
$query->whereNotExists(function ($query) {
|
$query->whereNotExists(function ($query) {
|
||||||
return $query->select(new Expression(1))
|
return $query->select(new Expression(1))
|
||||||
->from('discussions_tags')
|
->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'));
|
->where('discussions.id', new Expression('discussion_id'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -98,7 +98,7 @@ class SaveTagsToDatabase
|
|||||||
|
|
||||||
if ($discussion->exists) {
|
if ($discussion->exists) {
|
||||||
$oldTags = $discussion->tags()->get();
|
$oldTags = $discussion->tags()->get();
|
||||||
$oldTagIds = $oldTags->lists('id')->all();
|
$oldTagIds = $oldTags->pluck('id')->all();
|
||||||
|
|
||||||
if ($oldTagIds == $newTagIds) {
|
if ($oldTagIds == $newTagIds) {
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user