Skip to content

Conversation

@peterfox
Copy link
Collaborator

Changes

  • creates the new rule and adds it to the Laravel 12 set.
  • adds tests
  • updates docs

Why

Added in Laravel 12 laravel/framework#54450

 class User extends Model
 {
-    public function scopeActive($query)
+    #[\Illuminate\Database\Eloquent\Attributes\Scope]
+    public function active($query)
     {
         return $query->where('active', 1);
     }
 }

@peterfox peterfox self-assigned this Mar 21, 2025
@GeniJaho GeniJaho merged commit 40bbddd into main Mar 22, 2025
5 checks passed
@GeniJaho GeniJaho deleted the feature/scope-to-use-attribute-rule branch March 22, 2025 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants