hey i'm new to laravel Is that possible with Laravel 5.3 to connect to a existing database ? without make migrations manually ?
5
-
1Yes this is possible. Next question?Mayank Pandeyz– Mayank Pandeyz2017-04-19 09:08:15 +00:00Commented Apr 19, 2017 at 9:08
-
@MayankPandeyz do you have a link or something to show me how to connect with the database ?SHOSHA K– SHOSHA K2017-04-19 09:10:11 +00:00Commented Apr 19, 2017 at 9:10
-
migrations are only for creating table structures in database - they are not linked to connetctingNoOorZ24– NoOorZ242017-04-19 09:10:16 +00:00Commented Apr 19, 2017 at 9:10
-
@NoOorZ24 yes this is what i need i have created tables but i don't want to create 50 tables again is there any way to use them ?SHOSHA K– SHOSHA K2017-04-19 09:12:20 +00:00Commented Apr 19, 2017 at 9:12
-
1Just put database config info in your env file and create ModelsAutista_z– Autista_z2017-04-19 09:13:54 +00:00Commented Apr 19, 2017 at 9:13
Add a comment
|
1 Answer
Inside your project folder there is a file .env, in this file set the following DB details:
DB_CONNECTION=mysql
DB_HOST=192.168.1.12
DB_PORT=3306
DB_DATABASE=databasename
DB_USERNAME=username
DB_PASSWORD=*****
and run php artisan config:cache, your application is connected with the given DB details.
1 Comment
Mayank Pandeyz
Sounds great !!