Dodanie drukowania danych wysyłanych przez Plivo #66
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
|
||||
*/
|
||||
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('/edit/{id}/{slug?}', 'Main@edit');
|
||||
|
||||
Route::post('/sms', 'Plivo@recieveSms');
|
||||
|
||||
Route::post('/printImage', 'Main@imagePrint');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user