Find the best Rector rule to solve your problem. Searching through 671 rules.

Found 2 rules:

ContainerBindConcreteWithClosureOnlyRector

Drop the specified abstract class from the bind method and replace it with a closure that returns the abstract class.

-$this->app->bind(SomeClass::class, function (): SomeClass {
+$this->app->bind(function (): SomeClass {
     return new SomeClass();
 });

ScopeNamedClassMethodToScopeAttributedClassMethodRector

Changes model scope methods to use the scope attribute

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