0

I am designing a form in laravel to save a form which has fields like name, address and product name(it will be a GET method). So product name is to searched from database using jquery autocomplete plugin and ajax. My question is can we have POST and GET method on same view form in Laravel?

And if not then how can I achieve this, ie to save the name, address and filtered product name in db in one go onclick of submit button.

sphinks
  • 3,048
  • 8
  • 39
  • 55

1 Answers1

1

Try this one

Route::any('foo', function () {
    return 'Hello World';
});

Or

Route::match(['get', 'post'], '/', function () {
    return 'Hello World';
});
krunal nerikar
  • 436
  • 4
  • 12
  • thanks for the answer but my requirement is different.want to use ajax with jquery autocomplete.Help will be appreciated if you provide the controller function with autocomplete used with ajax in laravel. – user6536248 Jul 05 '16 at 13:00