Added way to recieve text messages and printing them.
This commit is contained in:
27
app/Http/Controllers/Plivo.php
Normal file
27
app/Http/Controllers/Plivo.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Paper\Paper;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class Plivo extends Controller
|
||||||
|
{
|
||||||
|
/** @var Paper */
|
||||||
|
private $paper;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->paper = new Paper();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function recieveSms(Request $request)
|
||||||
|
{
|
||||||
|
if ($request->isMethod('post')) {
|
||||||
|
$this->paper->sendPrint('SMS od '. $request->input('From'), $request->input('Text')."\n\n".date('d-m-Y H:i'), 'envelope-o');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -12,6 +12,6 @@ class VerifyCsrfToken extends BaseVerifier
|
|||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $except = [
|
protected $except = [
|
||||||
//
|
'sms'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ Route::get('/edit/{id}/{slug?}', 'Main@edit')->name('edit');
|
|||||||
Route::post('/print/{id}/', 'Main@printText')->name('print');
|
Route::post('/print/{id}/', 'Main@printText')->name('print');
|
||||||
Route::post('/edit/{id}/{slug?}', 'Main@edit');
|
Route::post('/edit/{id}/{slug?}', 'Main@edit');
|
||||||
|
|
||||||
|
Route::post('/sms', 'Plivo@recieveSms');
|
||||||
|
|
||||||
Route::post('/printImage', 'Main@imagePrint');
|
Route::post('/printImage', 'Main@imagePrint');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user