-1

Javascript

window.location.href = "{{ url('student/take_test')}}/"+encrypted; 

javascript id passing above method. encrypt id in javascript

Laravel

decrypt in laravel

Route::get('/student/take_test/{id}', 'App\Http\Controllers\Student\StudentController@take_test')

is that possible?

brombeer
  • 8,716
  • 5
  • 21
  • 27
  • Here is a similar question hope it helps https://stackoverflow.com/questions/27677236/encryption-in-javascript-and-decryption-with-php – dz0nika Nov 24 '22 at 09:05

1 Answers1

0
var encrypted = your_id;
var url = "{{ url('student/take_test/id')}}";
var new_url = url.replace('id', encrypted);

window.location.href = new_url;
  • Thank you for your answer but its not i am expecting, javascript url is id is passing in url encrypt that and decrypt in laravel – user20589036 Nov 24 '22 at 17:21