# arif98741/laravelbdsms architecture

> Architecture diagram of the GitHub repository arif98741/laravelbdsms, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arif98741/laravelbdsms
- Repository: https://github.com/arif98741/laravelbdsms

## Overview

##### Supporting Components

Database Layer:
- It to the Logger component
- Use gray to indicate persistence layer

Queue System:
- It to SendSmsJob
- Use orange to indicate async processing

##### Flow Directions

- Entry point through Facades
- Request flow through services
- Provider selection and message routing
- Logging operations
- Queue processing

##### Additional Details

Configuration:
- Configuration management
- Environment variable dependencies
- Provider-specific settings

Logging:
- Both database and file logging options
- Log flow paths

- The package's modular architecture
- Easy provider switching capability
- Queue support for async operations
- Comprehensive logging system
- Error handling and validation
- Configuration flexibility

Keep the abstraction level high enough to show the overall architecture but detailed enough to understand:
- How messages flow through the system
- How providers are selected and used
- How logging and queuing work
- How the system integrates with Laravel

This will create a clear visualization of how this SMS gateway package works while showing its flexibility in handling multiple providers and various sending scenarios.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Facade Layer"
        SMS_F["SMS Facade"]:::facade
        Logger_F["Logger Facade"]:::facade
        Request_F["Request Facade"]:::facade
    end

    subgraph "Core Service Layer"
        SMS_S["SMS Service"]:::service
        Sender["Sender Service"]:::service
        Request_H["Request Handler"]:::service
        Main["LaravelBDSms Service"]:::main
    end

    subgraph "Provider Layer"
        Provider["Abstract Provider"]:::provider
        subgraph "Concrete Providers"
            Provider1["Provider 1"]:::provider
            Provider2["Provider 2"]:::provider
            ProviderN["Provider N"]:::provider
        end
    end

    subgraph "Error Handling"
        Param_Ex["Parameter Exception"]:::error
        Render_Ex["Render Exception"]:::error
        Valid_Ex["Validation Exception"]:::error
    end

    subgraph "Persistence Layer"
        DB[(SMS Logs DB)]:::storage
        Logger["Logger"]:::util
    end

    subgraph "Queue System"
        Queue{"Queue"}:::queue
        SendJob["Send SMS Job"]:::job
    end

    subgraph "Configuration"
        Config["SMS Config"]:::config
        Helper["Helper Utilities"]:::util
    end

    %% Connections
    SMS_F --> SMS_S
    Logger_F --> Logger
    Request_F --> Request_H
    
    SMS_S --> Sender
    Sender --> Provider
    Provider --> Provider1
    Provider --> Provider2
    Provider --> ProviderN
    
    SMS_S --> Queue
    Queue --> SendJob
    SendJob --> Sender
    
    Sender --> Logger
    Logger --> DB
    
    Main --> SMS_S
    Main --> Config
    
    Request_H --> Param_Ex
    Request_H --> Render_Ex
    Request_H --> Valid_Ex

    %% Styles
    classDef facade fill:#FFE5CC,stroke:#FF9933
    classDef service fill:#C2E0C6,stroke:#2EA44F
    classDef provider fill:#D4C5F9,stroke:#6F42C1
    classDef error fill:#FFEBE9,stroke:#CF222E
    classDef storage fill:#DDD,stroke:#666
    classDef util fill:#B6E3FF,stroke:#0969DA
    classDef queue fill:#FFF1E5,stroke:#FF6B35
    classDef job fill:#FFE5CC,stroke:#FF9933
    classDef config fill:#FFF8C5,stroke:#BF8700
    classDef main fill:#79B8FF,stroke:#0969DA

    %% Click Events
    click SMS_F "https://github.com/arif98741/laravelbdsms/blob/master/src/Facades/SMS.php"
    click Logger_F "https://github.com/arif98741/laravelbdsms/blob/master/src/Facades/Logger.php"
    click Request_F "https://github.com/arif98741/laravelbdsms/blob/master/src/Facades/Request.php"
    click SMS_S "https://github.com/arif98741/laravelbdsms/blob/master/src/SMS.php"
    click Sender "https://github.com/arif98741/laravelbdsms/blob/master/src/Sender.php"
    click Request_H "https://github.com/arif98741/laravelbdsms/blob/master/src/Request.php"
    click Main "https://github.com/arif98741/laravelbdsms/blob/master/src/LaravelBDSmsServiceProvider.php"
    click Provider "https://github.com/arif98741/laravelbdsms/blob/master/src/Provider/AbstractProvider.php"
    click Provider1,Provider2,ProviderN "https://github.com/arif98741/laravelbdsms/tree/master/src/Provider/"
    click Param_Ex "https://github.com/arif98741/laravelbdsms/blob/master/src/Handler/ParameterException.php"
    click Render_Ex "https://github.com/arif98741/laravelbdsms/blob/master/src/Handler/RenderException.php"
    click Valid_Ex "https://github.com/arif98741/laravelbdsms/blob/master/src/Handler/ValidationException.php"
    click DB "https://github.com/arif98741/laravelbdsms/blob/master/src/Database/migrations/create_laravelbd_sms_table.php.stub"
    click Logger "https://github.com/arif98741/laravelbdsms/blob/master/src/Log/Log.php"
    click SendJob "https://github.com/arif98741/laravelbdsms/blob/master/src/Job/SendSmsJob.php"
    click Config "https://github.com/arif98741/laravelbdsms/blob/master/src/Config/sms.php"
    click Helper "https://github.com/arif98741/laravelbdsms/blob/master/src/Helper/Helper.php"
```
