diff --git a/composer.json b/composer.json index 97ecc9b..4f0a85d 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ } }, "require": { - "saucebase/core": "^2.8", + "saucebase/core": "^2.8.1", "laravel/socialite": "^5.31", "stechstudio/filament-impersonate": "^5.6.1", "laravel/passkeys": "^0.2.1" diff --git a/patches/user.patch b/patches/user.patch index e6b8bfd..ebd322b 100644 --- a/patches/user.patch +++ b/patches/user.patch @@ -6,12 +6,11 @@ +use Laravel\Passkeys\PasskeyAuthenticatable; +use Modules\Auth\Traits\Sociable; use Saucebase\Core\Settings\LocalizationSettings; -@@ -17,3 +20,3 @@ - --class User extends Authenticatable implements FilamentUser, HasLocalePreference, HasMedia -+class User extends Authenticatable implements FilamentUser, HasLocalePreference, HasMedia, PasskeyUser - // , MustVerifyEmail -@@ -24,2 +27,4 @@ +@@ -21,2 +24,3 @@ + HasLocalePreference, ++ PasskeyUser, + HasMedia +@@ -28,2 +32,4 @@ use Notifiable; + use PasskeyAuthenticatable; + use Sociable; diff --git a/tests/Feature/UserPatchTest.php b/tests/Feature/UserPatchTest.php new file mode 100644 index 0000000..c6fe7e9 --- /dev/null +++ b/tests/Feature/UserPatchTest.php @@ -0,0 +1,39 @@ +assertSame([], array_values($removed)); + } + + public function test_it_applies_to_the_user_core_ships(): void + { + $app = sys_get_temp_dir().'/user-patch-'.uniqid(); + File::ensureDirectoryExists($app.'/app/Models'); + File::copy(base_path('vendor/saucebase/core/stubs/app/app/Models/User.php'), $app.'/app/Models/User.php'); + + try { + $apply = new Process(['git', 'apply', '--check', realpath(self::PATCH)], $app); + + $this->assertSame(0, $apply->run(), $apply->getErrorOutput()); + } finally { + File::deleteDirectory($app); + } + } +}