Laravel for Beginners – Learn to Build Full-Stack Web Apps

Loading video...

Create HomeController for Project

Controllers

Create HomeController

Create new controller for our final project

php artisan make:controller HomeController

Open HomeController and add index method

class HomeController extends Controller
{
		public function index()
		{
				return 'index';
		}
}

Now open web.php and change / route

Route::get('/', [HomeController::class, 'index'])->name('home');

Now we don’t need resources/views/welcome.blade.php file, so let’s it.

Discussion

Sign in to join the discussion.

No comments yet. Be the first to start the discussion!