filament-companies: Cannot assign null to property Wallo\FilamentCompanies\Http\Controllers\OAuthController::$registrationUrl of type string
when using an php artisan console command i’m now gettting this error after upgrading to version v3.2.2
Cannot assign null to property Wallo\FilamentCompanies\Http\Controllers\OAuthController::$registrationUrl of type string
at vendor/andrewdwallo/filament-companies/src/Http/Controllers/OAuthController.php:58
54▕ $this->updatesConnectedAccounts = $updatesConnectedAccounts;
55▕ $this->invalidStateHandler = $invalidStateHandler;
56▕
57▕ $this->guard = Filament::auth();
➜ 58▕ $this->registrationUrl = Filament::getRegistrationUrl();
59▕ $this->loginUrl = Filament::getLoginUrl();
60▕ $this->userPanel = FilamentCompanies::getUserPanel();
61▕ }
62▕
When i dd(Filament::getCurrentPanel()); just above $this->guard = Filament::auth(); it returns a panel which does not have filamentCompanies plugin registered / enabled.
changing this line resolves the issue:
$this->registrationUrl = Filament::getRegistrationUrl() ?? '';
About this issue
- Original URL
- State: closed
- Created 4 months ago
- Comments: 25 (10 by maintainers)
@VincentLahaye If you want only the “Main” panel to have a login/register, then it would be a better practice to do something along the lines of this.
In your “Main” panel, mark it as default like so:
For your other panels, create a new class at
app/Http/Middleware/Authenticate.php
or use the default one provided by the Laravel skeleton, and use this code in it:Then in the other panels (the non-main ones), replace the default
Filament\Http\Middleware\Authenticate
middleware provided by Filament with the new middleware from above like so:You can look at my ERPSAAS repository as an example.