Laravel create controller using php artisan command

 php artisan command to create controller


php artisan make:controller UserController



Create a view(blade template) userhome.blade.php inside resources->views->userhome.blade.php

This will create a new template

http://127.0.0.1:8000/user

class UserController extends Controller
{
  public function index()
  {
     return view('userhome');
  }
}


Goto URL : http://127.0.0.1:8000/user

Comments

Popular Posts