From 24230f6e443dac9e04d66d76ec126cfbd132023d Mon Sep 17 00:00:00 2001 From: Eser DENIZ Date: Tue, 21 Nov 2023 09:42:11 +0000 Subject: [PATCH] [5.x] Fix Livewire component registration (#317) * Update SocialstreamServiceProvider.php * better handling * Like Jetstream * Doesn't work without afterResolving() * Even better --- src/SocialstreamServiceProvider.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/SocialstreamServiceProvider.php b/src/SocialstreamServiceProvider.php index 7a459e9d..359fde0e 100644 --- a/src/SocialstreamServiceProvider.php +++ b/src/SocialstreamServiceProvider.php @@ -6,7 +6,6 @@ use Illuminate\Support\Facades\Gate; use Illuminate\Support\Facades\Route; use Illuminate\Support\ServiceProvider; -use Illuminate\View\Compilers\BladeCompiler; use JoelButcher\Socialstream\Actions\AuthenticateOAuthCallback; use JoelButcher\Socialstream\Actions\CreateConnectedAccount; use JoelButcher\Socialstream\Actions\CreateUserFromProvider; @@ -42,13 +41,6 @@ class SocialstreamServiceProvider extends ServiceProvider public function register(): void { $this->mergeConfigFrom(__DIR__.'/../config/socialstream.php', 'socialstream'); - - $this->app->afterResolving(BladeCompiler::class, function () { - if (config('jetstream.stack') === 'livewire' && class_exists(Livewire::class)) { - Livewire::component('profile.set-password-form', SetPasswordForm::class); - Livewire::component('profile.connected-accounts-form', ConnectedAccountsForm::class); - } - }); } /** @@ -63,6 +55,11 @@ public function boot(): void $this->bootLaravelJetstream(); $this->bootFilament(); $this->bootInertia(); + + if(config('jetstream.stack') === 'livewire' && class_exists(Livewire::class)) { + Livewire::component('profile.set-password-form', SetPasswordForm::class); + Livewire::component('profile.connected-accounts-form', ConnectedAccountsForm::class); + } } /**