Reputation: 115
I'm new with laravel, I read the documentation of laravel, but I don't know how I make an authentication with a real mysql database. I mean, I see that there is a php migration command, but it makes a table in php and not in my database right ? Actually, I have a mysql database with a user table with login and password. I'm lost with this framework, because I never used a php framework.
Thanks !!
Edit : Excuse me, I misspoke and my problem has evolved, how did you to authenticate with a user table already exists in the database by using the Authentication service?
Upvotes: 0
Views: 700
Reputation: 296
I think you might need to read again Laravel documentations.
Try the following.
Try bellow code on your route.php
Route::get('/', function () { if(DB::connection()->getDatabaseName()) { echo "Yes! successfully connected to the DB: " . DB::connection()->getDatabaseName(); } });
If above is successful your migration should work.
Upvotes: 1
Reputation: 811
in .env or config>database.php you can set your database and related database connections configurations after that create migrations and run them it will create database tables in your database as per your .env or config>database.php database configurations.
Upvotes: 3