-1

I installed sanctum in my comany project (laravel9). when I used the command "php artisan migrate" it errored "In ConnectionFactory.php line 274: Unsupported driver [mongodb]".

While i use mysql and in my .env file the database is mysql. this is the error part of mentioned file(ConnectionFactory.php line 274).

protected function createConnection($driver, $connection, $database, $prefix = '', array $config = [])
    {
        if ($resolver = Connection::getResolver($driver)) {
            return $resolver($connection, $database, $prefix, $config);
        }

        return match ($driver) {
            'mysql' => new MySqlConnection($connection, $database, $prefix, $config),
            'pgsql' => new PostgresConnection($connection, $database, $prefix, $config),
            'sqlite' => new SQLiteConnection($connection, $database, $prefix, $config),
            'sqlsrv' => new SqlServerConnection($connection, $database, $prefix, $config),
            default => throw new InvalidArgumentException("Unsupported driver [{$driver}]."),
        };
    }

What is the problem?

Shadow
  • 33,525
  • 10
  • 51
  • 64

1 Answers1

0

change your DB_CONNECTION from MongoDB to MySQL or one of the supported database drivers.

supported drivers:

  • mysql
  • pgsql
  • sqlite
  • sqlsrv
A.Seddighi
  • 1,695
  • 1
  • 20
  • 43