dimanche 1 mai 2016

How to change database in laravel5

I am just starting to learn laravel. I had given a database name (eg: mydatabase1) while beginning. Now want to change the db(eg: mydatabase2). I have updated the new database name database.php and .env files. Still when i run a query in the model $users = DB::table('tbl_users')->limit(1)->get();, it gives me error like this SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydatabase1.tbl_users' doesn't exist (SQL: select * from 'tbl_users' limit 1), means its still considering first configuration. I wonder where i have to update to reflect the db name update. Please help



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire