From 3437f16d825c54b6433c03dfa567f0fc7bc58e75 Mon Sep 17 00:00:00 2001 From: Masroor Ehsan Date: Mon, 30 Dec 2024 22:47:32 +0600 Subject: [PATCH] misc --- app/Models/Study.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/Models/Study.php b/app/Models/Study.php index a315912..1cef46b 100644 --- a/app/Models/Study.php +++ b/app/Models/Study.php @@ -40,4 +40,19 @@ public function shares(): HasMany { return $this->hasMany(SharedStudy::class); } + + public function scopeActive($query) + { + return $query->where('is_archived', false); + } + + public function scopeArchived($query) + { + return $query->where('is_archived', true); + } + + public function scopeUnlocked($query) + { + return $query->where('is_locked', false); + } }