Database [] not configured Laravel 5

前端 未结 6 906
闹比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:52

    In my case I used 2 db connections and the second added was not cached, the command call: php artisan config:cache did the trick.

    To see what's going on it was sufficient to output the $connections variable in DatabaseManager->configure method.

提交回复
热议问题