MBS Mohammed Baobaid
All projects
Project
Public release Open Source Software Created 20 March 2022

Malath SMS Package

A Laravel package for sending Malath SMS messages and checking account balance through a small API wrapper.

Created 20 March 2022, Malath SMS Package is an early Laravel package I built around the Malath SMS API. It packages credentials, service-provider registration, migrations, message sending, and account balance lookup into a reusable Composer library.

Laravel PHP Composer Package Guzzle Eloquent Service Provider API Integration
Narrated walkthrough

This audio is not a word-for-word copy of the case below. You can read the written case while listening to me explain the project in more detail.

0:00 / 0:00
Speed
Malath SMS Package project preview
devhereco/malathsms Package
20 Mar 2022 Created
Send + balance API methods
Malath SMS Integration

Role

Package author and Laravel developer

Outcome

I turned a repeated SMS integration need into a Composer-ready Laravel package with auto-discovery, configurable credentials, Guzzle-based API calls, and stored delivery history.

The Challenge

SMS integrations are easy to scatter across controllers: credentials in one place, provider URLs in another, delivery history somewhere else, and balance checks handled manually. I wanted a small package that made the Malath integration reusable across Laravel projects.

The Approach

I wrapped the provider calls in a MalathSMS class, used Guzzle for HTTP requests, moved credentials into a publishable Laravel config file, registered the package through a service provider, and included a migration/model pair so sent messages could be recorded in an sms_histories table.

How it works

I packaged the Malath SMS workflow for Laravel

The package focuses on a narrow but useful problem: make Malath SMS sending available through a simple Laravel-facing API. Instead of wiring the provider URL, credentials, sender name, and request logic into every project, the package gives the application one reusable integration surface.

Configuration lives where Laravel developers expect it

The package reads MALATH_SMS_USERNAME, MALATH_SMS_PASSWORD, and MALATH_SMS_SENDER through a publishable malathsms.php config file. The service provider merges the config, exposes it for publishing, and loads the included migration.

The public API stays compact

MalathSMS::sendOneSide(...) sends a message to a receiver number through the Malath HTTP endpoint, while MalathSMS::getBalance() calls the balance endpoint and returns the available SMS balance. The API is intentionally small because the integration itself is small.

Message history is part of the package

The package includes an sms_histories migration and an SmsHistory Eloquent model. Each send stores the provider name, receiver phone, sender ID, message body, and status response so the host application can keep an operational trail.

What this project shows

This was one of my early package-building projects, and it shows the practical Laravel habits I was developing: Composer metadata, PSR-4 namespaces, service-provider registration, publishable configuration, migrations, Eloquent models, and external API calls kept behind a reusable class.

Results

  • Published the package structure as `devhereco/malathsms` with PSR-4 autoloading
  • Added Laravel auto-discovery for `Devhereco\MalathSMS\ServiceProvider`
  • Exposed a simple send helper for one-way SMS messages
  • Exposed a balance helper for checking the Malath account balance
  • Stored sent-message metadata in a package-owned SMS history model
  • Documented installation, environment variables, migrations, sending, and balance usage in the README

Key features

01 One-way SMS sending through `MalathSMS::sendOneSide(...)`
02 Account balance checks through `MalathSMS::getBalance()`
03 Environment-backed username, password, and sender configuration
04 Laravel package auto-discovery through Composer metadata
05 Publishable package configuration for `malathsms.php`
06 SMS history migration and model for provider, phone, sender, message, and status tracking

Tech stack

Laravel PHP Composer Package Guzzle Eloquent Service Provider API Integration
Project links

Interested in similar work?

I build systems like this for teams that need reliable engineering, clean interfaces, and measurable outcomes.