Skip to content

Commit

Permalink
Merge pull request #13987 from tonypartridge/patch-8
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Aug 20, 2024
1 parent 99c7039 commit 2675472
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/11-tenancy.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ If you're using the `requiresTenantSubscription()` configuration method, then yo

### Writing a custom billing integration

Billing integrations are quite simple to write. You just need a class that implements the `Filament\Billing\Contracts\Provider` interface. This interface has two methods.
Billing integrations are quite simple to write. You just need a class that implements the `Filament\Billing\Providers\Contracts\Provider` interface. This interface has two methods.

`getRouteAction()` is used to get the route action that should be run when the user visits the billing page. This could be a callback function, or the name of a controller, or a Livewire component - anything that works when using `Route::get()` in Laravel normally. For example, you could put in a simple redirect to your own billing page using a callback function.

Expand All @@ -304,7 +304,7 @@ Here's an example billing provider that uses a callback function for the route a

```php
use App\Http\Middleware\RedirectIfUserNotSubscribed;
use Filament\Billing\Contracts\Provider;
use Filament\Billing\Providers\Contracts\Provider;
use Illuminate\Http\RedirectResponse;

class ExampleBillingProvider implements Provider
Expand Down
2 changes: 1 addition & 1 deletion src/Panel/Concerns/HasRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public function getUrl(?Model $tenant = null): ?string

$hasTenancy = $this->hasTenancy();

if ((! $tenant) && $hasTenancy) {
if ((! $tenant) && $hasTenancy && $this->auth()->hasUser()) {
$tenant = Filament::getUserDefaultTenant($this->auth()->user());
}

Expand Down

0 comments on commit 2675472

Please sign in to comment.