Extending Functionality
namespace App\Services;
use Daycode\Curtain\Services\CurtainService;
class ExtendedCurtainService extends CurtainService
{
public function enableWithNotification(array $options = []): void
{
// Call parent implementation
parent::enable($options);
// Add custom notification logic
if (isset($options['notify'])) {
$this->sendNotifications($options['notify']);
}
}
protected function sendNotifications(array $channels): void
{
foreach ($channels as $channel) {
// Implement notification logic
match ($channel) {
'slack' => $this->notifySlack(),
'email' => $this->notifyEmail(),
default => null
};
}
}
}Last updated