mirror of
https://github.com/flarum/core.git
synced 2025-07-29 12:40:40 +02:00
Replaced depreciated helper function with classfull function
This commit is contained in:
@@ -10,12 +10,13 @@
|
|||||||
namespace Flarum\Mentions\Listener;
|
namespace Flarum\Mentions\Listener;
|
||||||
|
|
||||||
use Flarum\Event\ConfigurePostsQuery;
|
use Flarum\Event\ConfigurePostsQuery;
|
||||||
|
use Illuminate\Support\Arr;
|
||||||
|
|
||||||
class AddFilterByMentions
|
class AddFilterByMentions
|
||||||
{
|
{
|
||||||
public function handle(ConfigurePostsQuery $event)
|
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')
|
$event->query->join('post_mentions_user', 'posts.id', '=', 'post_mentions_user.post_id')
|
||||||
->where('post_mentions_user.mentions_user_id', '=', $mentionedId);
|
->where('post_mentions_user.mentions_user_id', '=', $mentionedId);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user