Explorar el Código

Update UserFilter model

Daniel Supernault hace 7 años
padre
commit
4db7b72747
Se han modificado 1 ficheros con 17 adiciones y 0 borrados
  1. 17 0
      app/UserFilter.php

+ 17 - 0
app/UserFilter.php

@@ -12,4 +12,21 @@ class UserFilter extends Model
         'filterable_type',
         'filter_type',
     ];
+
+    public function mutedUserIds($profile_id)
+    {
+    	return $this->whereUserId($profile_id)
+    		->whereFilterableType('App\Profile')
+    		->whereFilterType('mute')
+    		->pluck('filterable_id');
+    }
+
+
+    public function blockedUserIds($profile_id)
+    {
+    	return $this->whereUserId($profile_id)
+    		->whereFilterableType('App\Profile')
+    		->whereFilterType('block')
+    		->pluck('filterable_id');
+    }
 }