Flash message.

This commit is contained in:
kplaczek
2018-04-09 07:20:27 +02:00
parent 46d32b2cec
commit 162a736f12
2 changed files with 6 additions and 6 deletions

View File

@@ -160,17 +160,20 @@ class Main extends Controller
/**
* post::/print/{id}
* @param Request $request
* @param $id
* @return \Illuminate\Http\RedirectResponse
*/
public function printText($id)
public function printText(Request $request, $id)
{
$note = DB::table('note')->where('id', $id)->first();
$this->paper->sendPrint($note->topic, $note->text, $note->icon);
$request->session()->flash('status', 'Wydrukowano notatkę: ' . $note->topic . '!');
return back();
}
private function templateReplace($input){
private function templateReplace($input)
{
return str_replace(['[d]', '[m]', '[y]', '[h]', '[i]', '[s]'],
[date('d'), date('m'), date('Y'), date('H'), date('i'), date('s')],