From bd5fed9e12be2e9e4fd603214c41238d1716403f Mon Sep 17 00:00:00 2001 From: Nino <18269685+treyssatvincent@users.noreply.github.com> Date: Mon, 10 Nov 2025 15:26:56 +0000 Subject: [PATCH] add missing classes before toExtend on laravel preset Add missing `->classes()` before `->toExtend()` on the laravel preset for 2 namespaces. Otherwise you can't use interfaces on theses namespace. For example, if you create an interface `YourSuperRequestContract` on the `app/Http/Requests` namespace you will get this error: ``` Expecting 'app/Http/Requests/YourSuperRequestContract.php' to extend 'Illuminate\Foundation\Http\FormRequest'. ``` --- src/ArchPresets/Laravel.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ArchPresets/Laravel.php b/src/ArchPresets/Laravel.php index 7d094c36..85f72b5d 100644 --- a/src/ArchPresets/Laravel.php +++ b/src/ArchPresets/Laravel.php @@ -69,6 +69,7 @@ public function execute(): void ->toHaveSuffix('Request'); $this->expectations[] = expect('App\Http\Requests') + ->classes() ->toExtend('Illuminate\Foundation\Http\FormRequest'); $this->expectations[] = expect('App\Http\Requests') @@ -118,6 +119,7 @@ public function execute(): void ->toHaveMethod('handle'); $this->expectations[] = expect('App\Notifications') + ->classes() ->toExtend('Illuminate\Notifications\Notification'); $this->expectations[] = expect('App') @@ -128,6 +130,7 @@ public function execute(): void ->toHaveSuffix('ServiceProvider'); $this->expectations[] = expect('App\Providers') + ->classes() ->toExtend('Illuminate\Support\ServiceProvider'); $this->expectations[] = expect('App\Providers')