为什么我的Controller会连接不了
(1/1) InvalidArgumentException
Attribute [controller] does not exist.
你是laravel框架的话,是你没有引入DB类的命名空间,加上use DB就行
<?php namespace App\Http\Controllers; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\DB; class LibraryController extends Controller{ public function test1(){ $sql=DB::select('select * from user'); var_dump($sql); } }
你把代码贴出来