Create a Contact Us for in Laravel 9

 

 

Add routes to enable GET & POST requests

Set up the routes in routes > web.php to render the contact page via a GET request and send mails via the POST request (which has been specified in the form attribute above).

Route::get('/contact', 'PageController@contact')->name('contact');

Route::post('/contact', 'PageController@sendContactMail')->name('contact.send');