Skip to content

Laravel Notify Hub implements the Adapter pattern to unify notification delivery across multiple channels. The system standardizes diverse services under a consistent interface, enabling flexible channel selection and seamless extension with minimal code changes.

Notifications You must be signed in to change notification settings

klejvi-ajdini/laravel-notify-hub

Repository files navigation

Laravel Notify Hub

A Laravel 12 implementation of the Adapter Design Pattern for a unified notification delivery system.

Dashboard Overview

Laravel Notify Hub Dashboard

Key Concepts

  • Adapter Pattern: Demonstrates how adapters can unify different notification channels under a single interface
  • Extensibility: Easy addition of new notification channels through adapter implementation
  • Service Integration: Seamless integration with email, SMS, and other notification services
  • Laravel Integration: Utilizes Laravel's dependency injection and service container features

System Architecture

Notification Templates

  • App\Services\Notifications\BaseNotificationService: Abstract base service with common functionality
  • App\Services\Notifications\Adapters: Contains channel-specific adapters (EmailAdapter, SMSAdapter)
  • App\Services\Notifications\Factory: Creates appropriate adapters based on configuration
  • App\Models\NotificationLog: Tracks notification delivery and status
  • App\Models\NotificationTemplate: Manages reusable notification templates

Features

Notifications Overview

  • Unified notification API
  • Multiple delivery channels
  • Template management
  • Delivery tracking
  • Channel validation

Setup

  1. Clone repository:
git clone https://github.com/klejvi-ajdini/laravel-notify-hub.git
cd laravel-notify-hub
  1. Install dependencies:
composer install
npm install && npm run dev
  1. Environment setup:
cp .env.example .env
php artisan key:generate
php artisan migrate
  1. Configure services in .env:
MAIL_MAILER=smtp
DEFAULT_NOTIFICATION_CHANNEL=email
  1. Start server:
php artisan serve

Testing

Run tests:

php artisan test

Contributing

  1. Fork repository
  2. Create feature branch
  3. Submit pull request

License

MIT License

About

Laravel Notify Hub implements the Adapter pattern to unify notification delivery across multiple channels. The system standardizes diverse services under a consistent interface, enabling flexible channel selection and seamless extension with minimal code changes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages