#Routes
16 messages ยท Page 1 of 1 (latest)
The route('main') function is trying to find a route named main in your routes file, so you should edit your route as shown below.
Route::get('/', function () {
return view('main');
})->name('main');
Alternatively you can use url('/') to specify a route without a name..
ty โค๏ธ
FYI you can also do Route::view('/', 'main')->name('main')
thats the same?
yeah just a shorter way of writing it
Its been there by default I though its important to have that one there ๐
both are perfectly fine
if your following some sort of tutorial best to stick with it the same
No those other ones are not the same
Those are defining methods on the controller to use, not returning a view directly
Personally, I am not a fan of the Route::controller(..) method but you do you ๐
so far idk about other ways ๐ will see in future