Adding form action in html in laravel

前端 未结 12 1275
深忆病人
深忆病人 2020-12-29 21:10

I am unable to pass url in views html form action tag.

12条回答
  •  温柔的废话
    2020-12-29 21:56

    You need to set a name to your Routes. Like this:

    
        Route::get('/','WelcomeController@home')->name('welcome.home');
        Route::post('/', array('as' => 'log_in', 'uses' => 'WelcomeController@log_in'))->name('welcome.log_in');
        Route::get('home', 'HomeController@index')->name('home.index');
    
    

    I just put name on Routes that need this. In my case, to call from tag form at blade template. Like this:

    
    

    Or, You can do this:

    
    

提交回复
热议问题