From dc4e22535f583f1021672c93f7e199bd81704e4b Mon Sep 17 00:00:00 2001 From: Shohrat Date: Tue, 3 Oct 2023 17:12:38 +0500 Subject: [PATCH] scopes --- plugins/rainlab/user/models/User.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/rainlab/user/models/User.php b/plugins/rainlab/user/models/User.php index fdf8258..870543b 100644 --- a/plugins/rainlab/user/models/User.php +++ b/plugins/rainlab/user/models/User.php @@ -105,6 +105,10 @@ class User extends UserBase public static $loginAttribute = null; + public function scopeIsFeatured($query) + { + return $query->where('is_featured', 1)->where('type', '!=', 'simple'); + } /** * Sends the confirmation email to a user, after activating. * @param string $code