-
-
Save dgafka/bcd1eac46f873d6df26eda7cf7c610b4 to your computer and use it in GitHub Desktop.
multi-tenancy-12.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
final readonly class OrderService | |
{ | |
public function __construct(private FastDelivery $fastDelivery) {} | |
#[CommandHandler] | |
public function handle( | |
PlaceOrder $command, | |
#[Header('tenant')] $tenantName | |
) | |
{ | |
if ($this->fastDelivery->isEnabled($tenantName)) { | |
// Place order differently for Premium Tenant | |
}else { | |
// Do normal order process | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment