From 65d58f19dc5fc7046d757bd1d5e9dfa395bcba2d Mon Sep 17 00:00:00 2001 From: Mark Gregory Date: Wed, 11 Nov 2026 16:11:21 +0000 Subject: [PATCH] Initial Commit --- .../Providers/StylistServiceProvider.php | 19 +++++++++++ tests/Feature/StylistIntegrationTest.php | 32 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 tests/Feature/StylistIntegrationTest.php diff --git a/Modules/Stylist/Providers/StylistServiceProvider.php b/Modules/Stylist/Providers/StylistServiceProvider.php index 84d2510..90bb78d 100755 --- a/Modules/Stylist/Providers/StylistServiceProvider.php +++ b/Modules/Stylist/Providers/StylistServiceProvider.php @@ -121,6 +121,14 @@ final class StylistServiceProvider extends ServiceProvider $componentsPath = $themeViewsPath.'/components'; + // Register theme-owned Flux components, including custom icons. + // Flux resolves through the flux namespace. + $fluxPath = $themeViewsPath.'/flux'; + + if (is_dir($fluxPath)) { + Blade::anonymousComponentPath($fluxPath, 'flux'); + } + // The common theme is the application-wide owner of layouts, // authentication, settings and shared components. Livewire 4 // resolves its default full-page layout through layouts::app, @@ -195,6 +203,17 @@ final class StylistServiceProvider extends ServiceProvider // namespace as well as for ordinary view('...') lookups. $this->registerLayoutCompatibilityNamespace($stylist->backend()); + // Livewire 4 resolves class-based component views using a filesystem + // path rather than Laravel's themed view finder. Point it at the + // selected backend theme so settings components resolve correctly. + $backendLivewirePath = $backend->path() + .DIRECTORY_SEPARATOR.'views' + .DIRECTORY_SEPARATOR.'livewire'; + + if (is_dir($backendLivewirePath)) { + config()->set('livewire.view_path', $backendLivewirePath); + } + $finder = View::getFinder(); $themePaths = []; diff --git a/tests/Feature/StylistIntegrationTest.php b/tests/Feature/StylistIntegrationTest.php new file mode 100644 index 0000000..0cc1f6f --- /dev/null +++ b/tests/Feature/StylistIntegrationTest.php @@ -0,0 +1,32 @@ +toBeTrue() + ->and(View::exists('livewire.settings.security'))->toBeTrue() + ->and(View::exists('livewire.settings.profile'))->toBeTrue(); +}); + +it('registers the custom backend Flux icons', function () { + $html = Blade::render( + '' + ); + + expect($html)->toContain('actingAs(User::factory()->create()) + ->get(route('dashboard')) + ->assertOk(); +}); + +it('renders the authenticated security settings', function () { + $this->actingAs(User::factory()->create()) + ->withSession(['auth.password_confirmed_at' => time()]) + ->get(route('security.edit')) + ->assertOk(); +});