tzsk / sms Goto Github PK
View Code? Open in Web Editor NEWLaravel SMS Gateway Integration Package
License: MIT License
Laravel SMS Gateway Integration Package
License: MIT License
please help me i saw notification but i dont now how i can use this
can i use it for gammu ???
please add new release for new features and update composer. tnx.
thanks for this package
please add Kavenegar Voice Call
Thanks for your great package
I noticed this package works on localhost but it throws error on host cpanel
syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST)
That is my code:
$valid = $this->valid($number);
if (!$valid) {
return response()->json(['errors' => [
'phone' => [
'شماره تلفن نامعتبر است'
]
]], 422);
}
$user = User::wherePhone($number)->first();
$user = $this->addUserIfDoesNotExist($user, $number);
$code = $this->addCode($user);
Sms::send("کد فعالسازی شما $code میباشد ")->to([$number])->dispatch();
I tried this also:
Sms::send("کد فعالسازی شما $code میباشد ")->to($number)->dispatch();
Thanks in advance!
My credentials are correct, but i got this error:
"Smsir token could not be generated."
why ?
fgsdfgsdfgsdfsdfsdfg
sdf
sdf
gsdf
sdf
sfg
sdf
dfg
sdf
sdfsfsdf
gsd
fsdfs
df
It is a request, I need textlocal configuration
I am using this for 1 of my client, so I need configuration details.
How can it benefit other users?
Would help to all textlocal implementers
Centos, PHP 7.4, Mysql
http://290px.com/elearn/public/
Hello!
How to send bodyid and argument in MelliPayamakPatern?
do it support queue ?
'default' => env('SMS_DEFAULT', 'textlocal'),
Hi
I want to use farazsms pattern driver, but where I can set the template id and fill variables in the pattern?
Sms::via('farazsmspattern')->send($text)->to([$user->mobile])->dispatch();
Can set the gateway settings manually in controller?
something like this:
$chosenGateway = $request->gateway;
/* $request->gateway == twilio */
$chosenGateway->sid = $request->twilio_sid;
$chosenGateway->token= $request->twilio_token;
$chosenGateway->from= $request->twilio_from;
Sms::via($chosenGateway)->send("this message")->to(['Number 1', 'Number 2'])->dispatch();
i have taken following steps:
composer require tzsk/sms
php artisan vendor:publish --tag=config
changes config file in config/sms.php
calling these codes in required controller gives error:
`<?php
namespace App\Http\Controllers;
use App\Helper\Reply;
use App\Http\Requests\Sms\SendVerificationCode;
use App\Http\Requests\Sms\VerifyOTPCode;
use App\Notifications\NewUser;
use App\Traits\SmsSettings;
use App\User;
use Illuminate\Http\Request;
use Tzsk\Sms\Facades\Sms;
class VerifyMobileController extends Controller
{
use SmsSettings;
public function __construct()
{
parent::__construct();
$this->setSmsConfigs();
}
public function sendVerificationCode(SendVerificationCode $request)
{
sms()->send("this message")->to(['9999999999'])->dispatch();
}
}
OUTPUT:
{
"message": "Class does not exist",
"exception": "ReflectionException",
"file": "E:\wamp\www\laravael_project\vendor\tzsk\sms\src\SmsManager.php",
"line": 153,
"trace": [
{
"file": "E:\wamp\www\laravael_project\vendor\tzsk\sms\src\SmsManager.php",
"line": 153,
"function": "__construct",
"class": "ReflectionClass",
"type": "->"
},
{
"file": "E:\wamp\www\laravael_project\vendor\tzsk\sms\src\SmsManager.php",
"line": 69,
"function": "validateDriver",
"class": "Tzsk\Sms\SmsManager",
"type": "->"
},
{
"file": "E:\wamp\www\laravael_project\vendor\tzsk\sms\src\SmsManager.php",
"line": 45,
"function": "via",
"class": "Tzsk\Sms\SmsManager",
"type": "->"
},
{
"file": "E:\wamp\www\laravael_project\vendor\tzsk\sms\src\Provider\SmsServiceProvider.php",
......
................... so ON
`
please help me asap, i am stuck here
Thanks
Hi, what's your opinion about adding some features to each driver and a feature checking ability to the package?
for example, some SMS gateways can send bulk messages and some of them doesn't support bulk messages.
I can create the below syntax:
Sms::via('gateway')->whenSupportsBulkMessage(
function($sms){
$sms->sendBulk("this message")->to(['Number 1', 'Number 2'])->dispatch();
}
)->whenDoesntSupportBulkMessage(function($sms) {
function($sms){
$sms->send("this message")->to(['Number 1', 'Number 2'])->dispatch();
}
})
or something like the below syntax:
// check if given gateway supports bulk sending messages.
if (Sms::via('gateway')->supportsBulkMessage()) {
//
}
if I add this feature, would you merge it ?
hi there,
i try to use this package for farazsms. but its not working.
without any errors :)
i think farazsms updated web services documents.
Hi,
Can u please explain if I can use it as a notification channel for laravel 5.4 and how can it be implemented.
Thanks.
I'm using hashkey but the message is not being sent.
add Support for laravel 7.*
Hi,
Am getting the following error
On /opt/lampp/htdocs/laravel/vendor/tzsk/sms/src/Drivers/Textlocal.php line number 56
Hello,
I was given two different numbers by my provider and I'm now trying to add the usage in my controller, in usage I can select which driver to send my message from, but there is no an option to select the number.
is it possible to use this package in event class?
hi
thank you for this good package . i need event after send sms then store sms in db .
Why is foreach used in most drivers to send SMS to multiple numbers?
While 90% of the providers support simultaneous reception of several receivers.
In this case, to send SMS to 100 recipients, 100 connections must be created.
While it is easily sent with a connection.
On the other hand, an array of 100 items should be returned to the user as a response.
And the user parses it again with foreach.
While one answer is enough for all 100 item.
what is your opinion ?
If you agree, I will refactor the drivers that support this feature.
Add A helper function that returns the SmsManager object, Some people prefer helper functions instead of Laravel Facades.
The helper allow people to use package throught this way:
sms()->to($someOne)-> ...
same time gateway is disable please add Ability in error sending use second driver
I'm using laravel 7 and require guzzlehttp/guzzle 7.0.1. Can you support this version?
As I've multiple sender ID in my textlocal account, I want to use these sender ID dynamically when sending SMS. How to achieve this with this package by using TextLocal as default SMS Gateway.
Thanks.
I required the package via composer, added the class to providers array and alias as stated in instructions. after that when I did php artisan vendor:publish
I get no sms.php in my config folder.
I am running a laravel 5.4 project
I just tried to install the package with "composer require tzsk/sms"
but it doesn't install and get this error :
Using version ^4.0 for tzsk/sms
./composer.json has been updated
Running composer update tzsk/sms
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- tzsk/sms[4.0.0, ..., 4.0.1] require illuminate/support ~5.7|~5.8|^6.0|^7.0 -> found illuminate/support[v5.7.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev] but these
were not loaded, likely because it conflicts with another require.
- Root composer.json requires tzsk/sms ^4.0 -> satisfiable by tzsk/sms[4.0.0, 4.0.1].
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
hi,
I want to use smsir package but there is not its configuration!!
and I have a question, this package support Laravel v7?
Hello
install this package in laravel 8
but error Error: Using $this when not in object context in file C:****\vendor\tzsk\sms\src\Sms.php on line 35
please check
fgsdfgsdfgsdfsdfsdfg
sdf
sdf
gsdf
sdf
sfg
sdf
dfg
sdf
sdfsfsdf
gsd
fsdfs
df
this code:
return sms()->via($gateway)->send($message, function ($sms) use ($phones) {
$sms->to($phones);
});
had this error
<!doctype html>
<html class="theme-light">
<!--
Error: Call to undefined function App\Services\sms() in file /home/debug/public_html/messaging-service/app/Services/SmsService.php on line 11
what's your opinion about adding wiki
with multiple languages in this package?
I installed the client using composer, set up everything following the package documentation, but, when I run this line of code
Sms::send("Test 123")->to(['*********', '*********'])->dispatch();
I get this error:
Call to undefined method Nexmo\Application\Client::message()
Edit: from Whoops i can see that the error is thrown in file vendor/tzsk/sms/src/Drivers/Nexmo.php on line 50, but I really can't understand where the problem is, since there isn't any static call.
Laravel 5.5. I am getting this error i have written same code you provided.
not support laravel 6 !
the below error has showed in composer:
Checkout -> https://www.sms.net.bd/api
Hi,
Help me how i cab use template id to send sms because sending tempalte id is required.
I
Line 29 in 279c5f8
tzsk/sms 5.0.2 requires php ^7.4 -> your PHP version (8.0.0) does not satisfy that requirement.
fgsdfgsdfgsdfsdfsdfg
sdf
sdf
gsdf
sdf
sfg
sdf
dfg
sdf
sdfsfsdf
gsd
fsdfs
df
in farazsms gateway server ip has changed form 37.130.202.188 to 188.0.240.110
change it
I am using SNS and I have followed the installation guide. Messaging works well with the message type Promotional
however when switched to transactional
, it throws the aforementioned error.
Sms::send("Your Code")->to(['Number 1'])->dispatch();
Tried to encode the Message
attribute as a JSON object, but still threw the error. Any help would be greatly appreciated.
Using Laravel V7 with SMS version 5.2
hi , do u think returning the raw response recieved from gateway is a good idea? i think its not SOLID!
what do u think if i create a response wrapper for drivers ? agree with it or not?
How can I manually add configuration settings from here,
Sms::via('twilio')->send("this message")->to(['+9196*********'])->dispatch();
Twilio has Account SID, Auth Token, and Twilio number, instead of configuring config/sms.php
If I wanted to set it from the same chain, is it possible? if yes, please give me a short code for it.
Thank you
To Fix array_merge(): Argument #1 is not an array
please remove array_merge() functionality on Textlocal.php send() as it's the case which arises response as error on when the mobile number to send SMS is registered as dnd on Trai.
Code has to be changed as mentioned below
public function send()
{
$numbers = implode(",", $this->recipients);
$response = $this->client->request("POST", $this->settings->url, [
"form_params" => [
"username" => $this->settings->username,
"hash" => $this->settings->hash,
"numbers" => $numbers,
"sender" => urlencode($this->settings->sender),
"message" => $this->body,
],
]);
$data = $this->getResponseData($response);
return (object) $data;
}
Note: As I am using this package on my Laravel project when vendor folder get updated error arises so to fix this issue please change as soon as possible
Hi .
tzsk/sms has an error on upgrading laravel 8 to laravel 9
that is "illuminate/support" dependency used in tzsk/sms and can not used in laravel 9.
please check yourself.
"message": "Undefined index: gateway",
"exception": "ErrorException",
"file": "C:\Users\saber\Documents\saberprojects\behplus\messaging-service\vendor\tzsk\sms\src\Sms.php",
"line": 96,
this is not work on windows
return Sms::via('gateway')->send("this message", function($sms) {
$sms->to(['Number 1', 'Number 2']);
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.