Download the PHP package parsadanashvili/laravel-smsoffice without Composer
On this page you can find all versions of the php package parsadanashvili/laravel-smsoffice. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-smsoffice
Laravel SMSOffice Package
The Laravel SMSOffice package allows you to easily send SMS messages using the SMSOffice API. It provides a convenient way to integrate SMS functionality into your Laravel applications.
Credits
This package is a fork of the original work by lotuashvili/laravel-smsoffice. You can find the original repository here.
Installation
You can install the package using Composer:
If you're using Laravel 5.4 or lower, you'll need to manually add the service provider to your config/app.php
file. Open the config/app.php
file and add the SmsOfficeServiceProvider
to the providers array:
After adding the service provider, you'll need to publish the configuration:
Configuration
You'll need to set up the following environment variables in your .env
file:
Development
During development, you can set the SMS driver to log
by adding SMSOFFICE_DRIVER=log
to your .env
file. This will help you simulate SMS sending by logging the actions instead.
Usage
Using Notifications
-
In your
User
model (or any model you want to send notifications to), add arouteNotificationForSms()
method that returns the user's phone number: -
Create a notification class using the following Artisan command:
-
Inside the generated
SmsNotification
class, importSmsOfficeChannel
and add it to thevia()
method. Define thetoSms()
method to specify the content of your SMS: - You can now use this notification in your application to send SMS notifications to users:
Sending SMS Directly
If you want to send SMS messages without using notifications, you can do so directly:
Feel free to replace '599123456'
with the recipient's phone number and 'Your Message Here'
with the actual message content.
This should help clarify the installation process, configuration, and usage of the Laravel SMSOffice package.