Hide required route options in Laravel 5.0

How can I hide receive route parameters in laravel 5?

I mean that a route can have the required parameters, as well as optional parameters, I would like to know how to hide these parameters.

Here are the Laravel docs for route options

You can capture request URI segments in your route:

Route::get('user/{id}', function($id) { return 'User '.$id; }); 

If my domain is: example.com, when I access example.com/user/201348 , I would like the browser to have a URL: example.com/user , for example.

0
source share
1 answer

You do not need a receiving route, but a mail route.

 Route::get('user/', function(Request $request) { return 'User '.$request->get('id'); }); 

But keep in mind: you need to create a form to create a submit request.

 {{ Form::open(array('url' => 'user')) }} {{ Form::hidden('id', $userId); }} {{ Form::submit('Show user with id '.$userId); }} {{ Form::close() }} 
0
source

Source: https://habr.com/ru/post/1257949/


All Articles