Dodanie drukowania danych wysyłanych przez Plivo #66

Merged
krzysiej merged 1 commits from issue-65 into master 2018-10-26 08:58:19 +02:00
3 changed files with 29 additions and 1 deletions
Showing only changes of commit fbffeec3a3 - Show all commits

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

View File

@@ -12,6 +12,6 @@ class VerifyCsrfToken extends BaseVerifier
* @var array
*/
protected $except = [
//
'sms'
];
}

View File

@@ -20,6 +20,7 @@ Route::get('/edit/{id}/{slug?}', 'Main@edit')->name('edit');
Route::post('/print/{id}/', 'Main@printText')->name('print');
Route::post('/edit/{id}/{slug?}', 'Main@edit');
Route::post('/sms', 'Plivo@recieveSms');
Route::post('/printImage', 'Main@imagePrint');