Comments (8)
Required prerequisite package:
composer require softon/sms:dev-master
composer require "laravelcollective/html":"^5.2.0"
routes/routes.php
Route::get('sms','SMSController@sms')->name('sms');
Route::post('send-sms','SMSController@sendSMS')->name('sendSMS');
resources/views/sms.php
{{ Form::open(['route' => ['sendSMS']]) }}
<div class="form-group row">
{{ Form::label('mobile','Mobile No',['class' => 'col-md-3 col-form-label required']) }}
<div class="col-md-9">
{{ Form::text('mobile',null,['class' => 'form-control', 'autofocus' => 'autofocus']) }}
</div>
</div>
<div class="form-group row">
{{ Form::label('message','Message',['class' => 'col-md-3 col-form-label required']) }}
<div class="col-md-9">
{{ Form::text('message',null,['class' => 'form-control']) }}
</div>
</div>
<div class="form-group row">
<div class="col-md-9 ml-md-auto">
{{ Form::button('Save',['class'=>'btn btn-primary mr-3','type'=>'submit']) }}
</div>
</div>
{{ Form::close() }}
http/controllers/SMSController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Softon\Sms\Facades\Sms;
class SMSController extends Controller{
public function sms(){
return view('sms');
}
public function sendSMS(Request $request){
$mobile = $request->get('mobile');
$message = $request->get('message');
Sms::send_raw($mobile,$message);
return redirect()->route(' sms')->with('success','SMS sent successfully');
}
}
from sms.
Use send_raw method instead of send
Sms::send_raw('9090909090','Thank you for registering.');
from sms.
i would like to use custom class instead of default predefined template, that should able to send the SMS from input text box or textarea using POST method!!
from sms.
from sms.
from sms.
@rajasekar-d
Hi,
that method, which you suggested in previous post worked for me,
and one more thig i need is, config from database i mean, i need dynamic config for app/config/sms.php
so how can do it so!?
from sms.
Try this,
You have to place the below code into AppServiceProvider Boot section
foreach (Setting::pluck('key','name') as $value => $key) {
config()->set('nexmo.'.$key, $value);
}
from sms.
@rajasekar-d
Thank you for your responce,
and in above code example the Setting table should be serialized right!?
and the method config()->set(); overrided the config/sms.php!?
from sms.
Related Issues (13)
- Specify custom gateway for sending SMS HOT 2
- Js HOT 1
- Not able to send SMS via custom gateway HOT 2
- Laravel 7.x support HOT 1
- mVayoo not working HOT 1
- SMS gateway (need assistance)
- Response not implemented HOT 1
- Class Softon\Sms\Gateways\customGateway does not exist HOT 3
- ERR: 108, Invalid or missing api_id HOT 1
- Multiple messages send to same user HOT 3
- how to call clickatell SMS API using softon HOT 1
- Laravel 5.5 Support ??? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sms.