Recently 8 version of Laravel came out.
Using Composer Global Require Laravel / Installer
put the latest version of Laravel.
Create a controller using PHP Artisan Make: Controller Taskcontoller
and make it the standard index
method, which returns View Welcome
.
I registered it all in Rout, but I get an error
illuminate \ contracts \ CONTAINER \ BindingResolutionException
Target Class [TaskController] Does Not Exist.
TaskController
& lt;? php
Namespace App \ HTTP \ Controllers;
Use illuminate \ http \ request;
Class TaskController EXTENDS Controller
{
Public Function Index ()
{
RETURN VIEW ('WELCOME');
}
}
Web.php
& lt;? php
Use Illuminate \ Support \ Facades \ Route;
Route :: Get ('/', 'TaskController @ index');
Answer 1, Authority 100%
answer from English stackoverflow
Web.php
& lt;? php
Use Illuminate \ Support \ Facades \ Route;
Use App \ http \ controllers \ taskcontroller;
Route :: Get ('/', [TaskController :: Class, 'index']);