Added way to recieve text messages and printing them.

This commit is contained in:
kplaczek
2018-10-26 08:13:01 +02:00
parent 817b573258
commit fbffeec3a3
3 changed files with 29 additions and 1 deletions

View 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');
}
}
}