-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to send SMS instead of Template? #13
Comments
Use send_raw method instead of send |
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!! |
For Laravel
…On Wed, 1 Aug 2018 at 23:52, Rajasekar D ***@***.***> wrote:
Using traditional php or laravel?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ANbVa_lCIOsvKMVyFiyYUqDsfghIgytmks5uMfHugaJpZM4UPnrI>
.
--
*Santosh Hegde*
*9980230884*
|
Required prerequisite package:
routes/routes.php
resources/views/sms.php
http/controllers/SMSController.php
|
Hello...
Thank you very much for your post,
i will check it out...!!
…On Sun, 5 Aug 2018 at 20:05, Rajasekar D ***@***.***> wrote:
*Required prerequisite package:*
composer require softon/sms:dev-master
composer require "laravelcollective/html":"^5.2.0"
*routes/routes.php*
***@***.***')->name('sms');
***@***.***')->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');
}
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ANbVa8bTX5dE9vuHUNvAXVuV4Jib_P3Iks5uNwLEgaJpZM4UPnrI>
.
--
*Santosh Hegde*
*9980230884*
|
@rajasekar-d |
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);
} |
@rajasekar-d |
Hi,
This utilizes blade view templates to send SMS. ie.
but how to send sms using HTML form instead of blade view template!?
i have tried to put some text or variable instead of blade template, that is throwing error like:
the above method works fine with blade view template.
but i would like to use POST method.
The text was updated successfully, but these errors were encountered: