Database [] not configured Laravel 5

前端 未结 6 907
闹比i
闹比i 2021-01-08 00:59

I create new db in phpmyadmin and new tables.

Then i do

    public function next(Request $request){
    $langs = DB::connection(\'mydb\')->select(         


        
6条回答
  •  执念已碎
    2021-01-08 01:34

    You're using single connection, so you don't need to specify it:

    $langs = DB::table('lang')->get();
    

    You should use connection() method only when you're working with multiple DB connections.

提交回复
热议问题