Skip to content Skip to sidebar Skip to footer

Laravel Sql Issue On 5.5 Auth Validation

From a fresh project, I tried to rename the 'users' table to 'app.users'. I managed to update migrations by updating schema::create Schema::create('app.users', function (Blueprint

Solution 1:

Why are you trying to change the users table name? What you have changed so far is good, but it seems your database configuration is off.

If you are trying to access the schema app and table users, then you can set the database config in either your .env file like this:

DB_HOST=localhost
DB_DATABASE=app
DB_USERNAME=foo
DB_PASSWORD=bar

or in config/database.php (under the database driver). For example, if you're using MySql it looks like this:

'mysql' => [
            'driver'    => 'mysql',
            'host'      => 'localhost',
            'database'  => 'app',
            'username'  => 'foo',
            'password'  => 'bar',
        ],

Solution 2:

In your database.php you have to configure the App database too to which you are referring.

'app' => [
                'driver'    => 'mysql',
                'host'      => 'localhost',
                'database'  => 'app',
                'username'  => 'foo',
                'password'  => 'bar',
            ],


    'mysql' => [
                    'driver'    => 'mysql',
                    'host'      => 'localhost',
                    'database'  => 'app',
                    'username'  => 'foo',
                    'password'  => 'bar',
                ],

Hope this helps.

Post a Comment for "Laravel Sql Issue On 5.5 Auth Validation"