View without controllers

If you want route to just show a certain view, don't create a Controller method, just use Route::view() function.

1// Instead of this
2Route::get('about', 'TextsController@about');
3// And this
4class TextsController extends Controller
5{
6 public function about()
7 {
8 return view('texts.about');
9 }
10}
11// Do this
12Route::view('about', 'texts.about');

Like our articles?

Become a Premium Member for $129/year or $29/month
What else you will get:
  • 22 courses (477 lessons, total 38 h 20 min)
  • 2 long-form tutorials (one new every week)
  • access to project repositories
  • access to private Discord