Skip to content

Commit

Permalink
[5.x] Fix Livewire component registration (#317)
Browse files Browse the repository at this point in the history
* Update SocialstreamServiceProvider.php

* better handling

* Like Jetstream

* Doesn't work without afterResolving()

* Even better
  • Loading branch information
SRWieZ authored Nov 21, 2023
1 parent 4e6f756 commit 24230f6
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/SocialstreamServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
});
}

/**
Expand All @@ -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);
}
}

/**
Expand Down

0 comments on commit 24230f6

Please sign in to comment.