I have been trying to fix this for a while now, for some reason, the program can not find the class controller, even though it is there. I have tried restarting the server, I have tried to use all kinds of uses. And it still does not work. What am I doing wrong here?
Web.php:
<?php
use App\Http\Controllers\todoListController;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', function () {
return view('welcome');
});
Route::get('/todolist', 'todoListController@show');
The todoListController:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class todoListController extends Controller
{
public function show() {
$tasks = Tasks::all();
return view('index', [
'tasks' => $tasks,
]);
}
}