Replaced depreciated helper function with classfull function

This commit is contained in:
Matthew Kilgore 2020-07-25 21:08:49 -04:00
parent ba3071eaac
commit d1cf21dcd2

View File

@ -10,12 +10,13 @@
namespace Flarum\Mentions\Listener;
use Flarum\Event\ConfigurePostsQuery;
use Illuminate\Support\Arr;
class AddFilterByMentions
{
public function handle(ConfigurePostsQuery $event)
{
if ($mentionedId = array_get($event->filter, 'mentioned')) {
if ($mentionedId = Arr::get($event->filter, 'mentioned')) {
$event->query->join('post_mentions_user', 'posts.id', '=', 'post_mentions_user.post_id')
->where('post_mentions_user.mentions_user_id', '=', $mentionedId);
}