<?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\DB;
class StudentController extends Controller {
public function test1 () {
$students = DB::select('select * from student');
var_dump($students);
}
配置文件改一下,应该是在数据库的那项配置上填了数据库的用户名了....