basic controller not found laravel php

advertisements
<?php namespace vendor\laravel\framework\src\Illuminate\Support\Facades;

use DB;
use BaseController;

class ModuleController extends BaseController{
    public function index()
    {
        //Display data from students table.
        $data=DB::connection('mysql')->select('select * from students');
    }
}

Error message:Fatal error: Class 'BaseController' not found in C:\xampp\htdocs\laravel\test.php on line 6


You need to change

use BaseController;

to

use Illuminate\Routing\Controller as BaseController;

Also, you'll have an error with DB. You need to use

use Illuminate\Support\Facades\DB;

instead of

use DB;

also namespace :)

namespace App\Http\Controllers;

instead of

namespace vendor\laravel\framework\src\Illuminate\Support\Facades;

Try to learn some OOP basics before using Laravel.