Download the PHP package abather/sms4jawaly without Composer
On this page you can find all versions of the php package abather/sms4jawaly. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download abather/sms4jawaly
More information about abather/sms4jawaly
Files in abather/sms4jawaly
Package sms4jawaly
Short Description SMS4Jawaly SDK for Laravel applications
License MIT
Informations about the package sms4jawaly
4Jawaly Laravel SDK
A comprehensive Laravel SDK for the 4Jawaly SMS gateway service. This package provides an elegant and simple API for sending SMS messages, checking account balance, retrieving sender names, and seamless integration with Laravel's Notification system.
مكتبة شاملة لإطار العمل Laravel للتكامل مع خدمة بوابة الرسائل القصيرة فورجوالي. توفر هذه الحزمة واجهة برمجية بسيطة وأنيقة لإرسال الرسائل النصية القصيرة، والاطلاع على رصيد الحساب، واستعراض أسماء المرسلين، مع دعم كامل لنظام الإشعارات في Laravel.
Table of Contents | جدول المحتويات
- Features
- Requirements
- Installation
- Configuration
- Usage
- Sending SMS
- Getting Account Balance
- Getting Sender Names
- Using Laravel Notifications
- API Reference
- Error Handling
- Contributing
- License
Features | المميزات
- ✅ Send SMS messages to single or multiple recipients | إرسال الرسائل القصيرة لمستلم واحد أو متعددين
- ✅ Check account balance and active packages | الاطلاع على رصيد الحساب والباقات النشطة
- ✅ Retrieve available sender names | استعراض أسماء المرسلين المتاحة
- ✅ Full Laravel Notification Channel support | دعم كامل لقنوات الإشعارات في Laravel
- ✅ On-demand notifications without user model | إرسال الإشعارات الفورية دون نموذج مستخدم
- ✅ Automatic service provider registration | تسجيل تلقائي لمزود الخدمة
- ✅ Simple Facade for easy access | واجهة Facade بسيطة للوصول السريع
- ✅ Comprehensive error handling | معالجة شاملة للأخطاء
Requirements | المتطلبات
- PHP >= 7.2
- Laravel Framework (any version)
- Guzzle HTTP Client ^7.0
Installation | التثبيت
Install the package via Composer:
قم بتثبيت الحزمة باستخدام Composer:
The service provider will be automatically registered thanks to Laravel's package auto-discovery.
سيتم تسجيل مزود الخدمة تلقائياً بفضل خاصية الاكتشاف التلقائي في Laravel.
Configuration | الإعداد
1. Publish Configuration | نشر ملف الإعدادات
Publish the package configuration file to your application:
انشر ملف إعدادات الحزمة إلى تطبيقك:
This will create a config/sms-4-jawaly.php file in your application.
سيؤدي هذا إلى إنشاء ملف config/sms-4-jawaly.php في تطبيقك.
2. Environment Variables | متغيرات البيئة
Add your 4Jawaly API credentials to your .env file:
أضف بيانات الاعتماد الخاصة بـ 4Jawaly في ملف .env:
3. Configuration File | ملف الإعدادات
The published configuration file config/sms-4-jawaly.php contains:
يحتوي ملف الإعدادات المنشور config/sms-4-jawaly.php على:
Note: If you're using configuration caching (
php artisan config:cache), remember to clear and recache after making changes.ملاحظة: إذا كنت تستخدم التخزين المؤقت للإعدادات (
php artisan config:cache)، تذكر مسح وإعادة التخزين المؤقت بعد إجراء التغييرات.
Usage | الاستخدام
Sending SMS | إرسال الرسائل القصيرة
Using the Gateway Class | استخدام كلاس Gateway
You can resolve the Gateway class directly from Laravel's service container:
يمكنك استدعاء كلاس Gateway مباشرة من حاوية خدمات Laravel:
Using the Facade | استخدام الـ Facade
Alternatively, use the convenient Facade:
أو استخدم الـ Facade البسيط:
Getting Account Balance | الاطلاع على الرصيد
Retrieve your current account balance and active packages:
استعرض رصيد حسابك والباقات النشطة:
Getting Sender Names | الحصول على أسماء المرسلين
Retrieve all available sender names for your account:
استعرض جميع أسماء المرسلين المتاحة لحسابك:
Using Laravel Notifications | استخدام نظام الإشعارات
The package provides a notification channel for seamless integration with Laravel's notification system.
توفر الحزمة قناة إشعارات للتكامل السلس مع نظام الإشعارات في Laravel.
Creating a Notification | إنشاء إشعار
Create a notification class using Laravel's artisan command:
أنشئ كلاس الإشعار باستخدام أمر artisan:
Then implement the notification:
ثم قم بتطبيق الإشعار:
Message Class Methods | طرق كلاس Message
The Message class provides a fluent interface for building SMS messages:
يوفر كلاس Message واجهة سلسة لبناء الرسائل:
Simple String Response | الاستجابة بنص بسيط
For simple messages, you can return a string directly:
للرسائل البسيطة، يمكنك إرجاع نص مباشرة:
Sending Notifications | إرسال الإشعارات
Send the notification to a user model:
أرسل الإشعار إلى نموذج المستخدم:
Routing Notifications | توجيه الإشعارات
The channel automatically routes notifications using:
تقوم القناة تلقائياً بتوجيه الإشعارات باستخدام:
routeNotificationFor('sms-4-jawaly')method on the notifiablerouteNotificationFor(Sms4JawalyChannel::class)method on the notifiable- The configured
receiver_attribute(default:phone) property on the notifiable
You can customize the routing in your User model:
يمكنك تخصيص التوجيه في نموذج المستخدم:
On-Demand Notifications | الإشعارات الفورية
Send notifications without associating them with a specific user model:
أرسل الإشعارات دون ربطها بنموذج مستخدم محدد:
Send to multiple numbers:
الإرسال لعدة أرقام:
API Reference | مرجع الـ API
Gateway Class
sendSms(string $message, array $numbers, string $sender): array
Sends an SMS message to one or more recipients.
Parameters:
$message(string): The message text to send$numbers(array): Array of recipient phone numbers in international format$sender(string): The sender name/ID
Returns:
getBalance(): array
Retrieves the current account balance and active packages.
Returns:
getSenders(): array
Retrieves all available sender names for the account.
Returns:
Message Class
make(string $message): Message
Static factory method to create a new Message instance.
message(string $message): self
Set or update the message text.
phone(string|array $phone): self
Set the recipient phone number(s).
sender(string $sender): self
Set the sender name.
getMessage(): string
Get the message text.
getPhone(): string|array
Get the recipient phone number(s).
getSender(): string
Get the sender name (returns default sender if not set).
Error Handling | معالجة الأخطاء
All Gateway methods return arrays with a success key. Always check this before processing the response:
جميع طرق Gateway ترجع مصفوفات تحتوي على مفتاح success. تحقق دائماً من هذا المفتاح قبل معالجة الاستجابة:
For balance and sender retrieval:
للرصيد وأسماء المرسلين:
Contributing | المساهمة
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
نرحب بمساهماتكم! لا تتردد في إرسال Pull Request. للتغييرات الكبيرة، يرجى فتح Issue أولاً لمناقشة ما تريد تغييره.
Development Setup
License | الترخيص
This package is licensed under the MIT License. See the LICENSE file for more information.
هذه الحزمة مرخصة تحت رخصة MIT. راجع ملف LICENSE لمزيد من المعلومات.
About | حول
This package is a fork of the official 4Jawaly SDK, enhanced with additional features and improvements for better Laravel integration.
هذه الحزمة مشتقة من الحزمة الرسمية لـ 4Jawaly، مع تحسينات وميزات إضافية لتكامل أفضل مع Laravel.
Made with ❤️ for the Laravel community | صُنع بـ ❤️ لمجتمع Laravel