使用laravel的db插入数据
DB::table('tags')->insert(
['name'=>'test']
);
报错Class 'App\Http\Controllers\DB' not found and I also cannot use a new Model
解决方法:
在DB前面加个反斜杠
\DB::table('tags')->insert(
['name'=>'test']
);
使用laravel的db插入数据
DB::table('tags')->insert(
['name'=>'test']
);
报错Class 'App\Http\Controllers\DB' not found and I also cannot use a new Model
解决方法:
在DB前面加个反斜杠
\DB::table('tags')->insert(
['name'=>'test']
);