mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 19:54:04 +00:00
Rename $mailersToAlwaysResolve to $tenantMailers
This commit is contained in:
parent
4016bc17ba
commit
56a24ecff6
1 changed files with 6 additions and 6 deletions
|
|
@ -13,7 +13,7 @@ use Stancl\Tenancy\Bootstrappers\MailTenancyBootstrapper;
|
||||||
*
|
*
|
||||||
* Tenancy swaps Laravel's MailManager singleton for an instance of this class,
|
* Tenancy swaps Laravel's MailManager singleton for an instance of this class,
|
||||||
* which overrides the manager's get method to always resolve
|
* which overrides the manager's get method to always resolve
|
||||||
* the mailers specified in the static $mailersToAlwaysResolve property
|
* the mailers specified in the static $tenantMailers property
|
||||||
* instead of getting them from the $mailers property where they're cached.
|
* instead of getting them from the $mailers property where they're cached.
|
||||||
*
|
*
|
||||||
* This is mainly used to solve the issue where
|
* This is mainly used to solve the issue where
|
||||||
|
|
@ -26,21 +26,21 @@ use Stancl\Tenancy\Bootstrappers\MailTenancyBootstrapper;
|
||||||
class TenancyMailManager extends MailManager
|
class TenancyMailManager extends MailManager
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Names of mailers which will always get re-resolved even when they're
|
* Mailers which will always get resolved even when they're
|
||||||
* cached & available in the $mailers property.
|
* cached & available in the $mailers property.
|
||||||
*/
|
*/
|
||||||
public static array $mailersToAlwaysResolve = [
|
public static array $tenantMailers = [
|
||||||
'smtp',
|
'smtp',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override the get method so that the mailers in $mailersToAlwaysResolve
|
* Override the get method so that the mailers in $tenantMailers
|
||||||
* always get resolved even when they're cached and available in the $mailers property
|
* always get resolved, even when they're cached and available in the $mailers property
|
||||||
* for the mailers to have the up-to-date tenant credentials.
|
* for the mailers to have the up-to-date tenant credentials.
|
||||||
*/
|
*/
|
||||||
protected function get($name)
|
protected function get($name)
|
||||||
{
|
{
|
||||||
if (in_array($name, static::$mailersToAlwaysResolve)) {
|
if (in_array($name, static::$tenantMailers)) {
|
||||||
return $this->resolve($name);
|
return $this->resolve($name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue