How to hide url values in php laravel?

Member

by dana , in category: Third Party Scripts , 13 days ago

How to hide url values in php laravel?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by darion , 13 days ago

@dana 

In Laravel, you can hide URL values by passing them through the session. Here's a step-by-step guide on how to do it:

  1. Store the value in the session:
1
session()->put('hidden_value', $value);


  1. Retrieve the value from the session in your controller:
1
$value = session('hidden_value');


  1. In your blade file, instead of passing the value directly in the URL, you can pass the session key:
1
{{ route('your.route.name', ['hidden_value' => 'hidden_value']) }}


  1. Retrieve the value in your controller using the session key:
1
$value = session('hidden_value');


By following these steps, you can hide URL values in Laravel by storing them in the session.