-1

I dont know receive data by post in my laravel application.

I already build the function to receive by GET, but, i think via post would be better.

How can I do? Is the same as normal PHP?

Thx

Eric Teixeira
  • 363
  • 2
  • 7
  • 17

1 Answers1

2

Similar to GET

In your Router add a route:

Route::post('home/doStuff/{withSomeParam}', 'YourController@doStuff');

Then in YourController controller:

public function doStuff($someParamId, Request $request){
    ... do something awesome with someParamId
    return redirect('home');

} 

And you are done =]

Alp
  • 3,027
  • 1
  • 13
  • 28