A
A
Alexander2017-02-05 13:42:51
Laravel
Alexander, 2017-02-05 13:42:51

How to process different POSTs on the same URL in Laravel 5?

Good afternoon!
As in Laravel 5, handle different POST requests on the same page, for example:
Route::post('clients/registration', '[email protected]');
Route::post('clients/registration', '[email protected]');
Route::post('clients/registration', '[email protected]');
Well, for example, in the form we will send the name of the function to be called in a hidden field. Or is it done in some other way?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WQP, 2017-02-05
@WQP

Hold stackoverflow.com/questions/32279329/handle-multip...

A
Alexander Sisyukin, 2017-02-05
@Caarl

Anonymous functions in the route can help, or pass it to the controller and resolve it there.
Anonymous Functions
Route::post('clients/registration', function(){
If ($_POST[PARAN]){
Your controller from a hidden field ;}});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question