Find a Rector rule
Find the best Rector rule to solve your problem. Searching through 1008 rules.
Found 2 rules, grouped by set: Clear
laravel/framework 12
2 matches
ScopeNamedClassMethodToScopeAttributedClassMethodRector
laravel/framework >=12.4
Changes model scope methods to use the scope attribute
class User extends Model
{
- public function scopeActive($query)
+ #[\Illuminate\Database\Eloquent\Attributes\Scope]
+ protected function active($query)
{
return $query->where('active', 1);
}
}
ContainerBindConcreteWithClosureOnlyRector
laravel/framework >=12.0
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();
});