bakalarska_praca/app/Http/Controllers/EnrollUserController.php
2023-05-11 21:57:12 +02:00

23 lines
579 B
PHP
Executable File

<?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 ÃspeÅnÃý!');
} else {
return redirect()->route('add-user')->with('success', 'Nastala cbyba!');
}
}
}