Skip to content

Commit

Permalink
Merge pull request #88 from andrewdwallo/development
Browse files Browse the repository at this point in the history
fix company invitations configuration
  • Loading branch information
andrewdwallo authored Sep 9, 2023
2 parents 3ba56dd + 22d8232 commit 6708ffb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Features.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,10 @@ public function api(bool|Closure|null $condition = true): static
/**
* Determine if the company is supporting company features.
*/
public function companies(bool|Closure|null $condition = true, bool|Closure|null $invitations = null): static
public function companies(bool|Closure|null $condition = true, bool $invitations = false): static
{
static::$hasCompanyFeatures = $condition instanceof Closure ? $condition() : $condition;
static::$sendsCompanyInvitations = $invitations instanceof Closure ? $invitations() : $invitations ?? false;
static::$sendsCompanyInvitations = $invitations;

return $this;
}
Expand Down Expand Up @@ -297,7 +297,7 @@ public static function hasCompanyFeatures(): bool
*/
public static function sendsCompanyInvitations(): bool
{
return static::$sendsCompanyInvitations;
return static::hasCompanyFeatures() && static::$sendsCompanyInvitations;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/FilamentCompanies.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public function api(bool|Closure|null $condition = true): static
/**
* Determine if the application supports the companies features.
*/
public function companies(bool|Closure|null $condition = true, bool|Closure|null $invitations = null): static
public function companies(bool|Closure|null $condition = true, bool $invitations = false): static
{
$this->features->companies($condition, $invitations);

Expand Down

0 comments on commit 6708ffb

Please sign in to comment.