Laravel:调用从路径中的同一控制器发布方法功能

I have three functions in my controller.One of them is GET type and other two is POST type. One POST type is working well but how can i call the second POST method from Route?

i am calling my functions from route like this and they are working well

Route::get('/conference/home', 'ViewController@index');
Route::post('/conference/home','ViewController@showBooking');

there is another function for Deleting from database which is a post method type. Say the Name of that Function is DeletingRecord(). How can i call this function from Route?

Some considerations:

  1. A controller method is not inherently a POST or GET method. It's the router that decides how to handle a POST or GET request.

  2. If you must use a POST request to delete a record then you must assign it to a different route name. Each route will resolve to exactly one method. For example:

    Route::get('/conference/home', 'ViewController@index');
    Route::post('/conference/home','ViewController@showBooking');
    Route::post('/conference/delete','ViewController@DeletingRecord');
    
  3. There's no reason why you can't use the DELETE method for this:

    Route::get('/conference/home', 'ViewController@index');
    Route::post('/conference/home','ViewController@showBooking');
    Route::delete('/conference/home','ViewController@DeletingRecord');
    

You can use delete HTTP verb.

then your code will look like this:

Route::get('/conference/home', 'ViewController@index');
Route::post('/conference/home','ViewController@showBooking');
Route::delete('/conference/home','ViewController@DeletingRecord');

why you don't use single routing line instead of more routing line as following:

Route::resource('conference', 'ViewController');

for reference please see following link:

https://laravel.com/docs/5.3/controllers#resource-controllers

i hope its help you