Answer the question
In order to leave comments, you need to log in
What to do about this Laravel error?
I'm quite new to Laravel , I came across this problem while learning.
routes/web.php:
<?php
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', function () {
return view('home');
})->name('home');
Route::get('/about', function () {
return view('about');
})->name('about');
Route::get('/contact', function () {
return view('contact');
})->name('contact');
Route::post('/contact/submit', '[email protected]')->name('contact-form');
Answer the question
In order to leave comments, you need to log in
Routing has changed in Laravel 8.
use App\Http\Controllers\ContactController;
Route::post('/contact/submit', [ContactController::class, 'submit'])->name('contact-form');
Route::post('/contact/submit', [\App\Http\Controllers\ContactController::class, 'submit'])->name('contact-form');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question