Skip to main content
Mohammed BaobaidDeveloper & data analyst
Open Source Software

Malath SMS Package

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

My role
Package author and Laravel developer
Project context
Public release
Timeline
Created 20 March 2022

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.

Malath SMS Package project preview
Package
devhereco/malathsms
Created
20 Mar 2022
API methods
Send + balance
Integration
Malath SMS
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

01 / Context

The brief.
The approach.

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.

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.

Behind the work

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.

02 / Impact

What changed.

  • 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

Tools & technologies

  • Laravel
  • PHP
  • Composer Package
  • Guzzle
  • Eloquent
  • Service Provider
  • API Integration

Continue exploring

Explore the project resources or get in touch about a role, a collaboration, or a similar brief.

Discuss an opportunity