bakalarska_praca/app/Http/Controllers/EnrollUserController.php

23 lines
579 B
PHP
Raw Permalink Normal View History

2023-05-11 19:57:12 +00:00
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Session;
use Illuminate\Http\JsonResponse;
class EnrollUserController extends Controller
{
public function enrollUserAction(Request $request){
$name = \request('name');
$output = shell_exec('python3 enroll_raspberrypi.py ' . $name);
if($output){
return redirect()->route('add-user')->with('success', 'Pridanie bolo <20>spe<70>n<EFBFBD>ý!');
} else {
return redirect()->route('add-user')->with('success', 'Nastala cbyba!');
}
}
}