Run Rector on your code to see what it can do for you:

 <?php
   
 use Illuminate\Support\Facades\App;                                                                                                                                      
 
 final class ChildClass extends ParentClass
 {
+    final public function __construct(protected string $name, private readonly \Illuminate\Foundation\Application $application)
+    {
+        parent::__construct($name);
+    }
     public function resolve(): SomeService
     {
-        return App::make(SomeService::class);
+        return $this->application->make(SomeService::class);
     }
 }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: 3ce9bb - released at 2026-05-21 21:48