| Requirement | Version |
|---|---|
| PHP | ^8.3 |
| Laravel | ^11.0 | ^12.0 | ^13.0 |
| Fast2SMS account | Sign up free |
composer require itxshakil/laravel-fast2sms
Laravel automatically discovers the service provider and facade. No manual registration is needed for Laravel 11+.
If you have disabled package auto-discovery, add the following to config/app.php:
'providers' => [
// ...
Shakil\Fast2sms\Fast2smsServiceProvider::class,
],
'aliases' => [
// ...
'Fast2sms' => Shakil\Fast2sms\Facades\Fast2sms::class,
],
php artisan vendor:publish --tag=fast2sms-config
This creates config/fast2sms.php in your application.
Add your Fast2SMS API key to .env:
FAST2SMS_API_KEY=your_api_key_here
You can find your API key in the Fast2SMS developer panel.
If you want to log SMS sends to the database, publish and run the migrations:
php artisan vendor:publish --tag=fast2sms-migrations
php artisan migrate
Then enable database logging in .env:
FAST2SMS_DATABASE_LOGGING=true
For local development, use the log driver to avoid making real API calls:
FAST2SMS_DRIVER=log
All sends will be written to your Laravel log instead of hitting the Fast2SMS API.
How can I help you explore Laravel packages today?