'unsupported driver [https], laravel when deployed to heroku

I am trying to deploy a Laravel application to Heroku and connect it with a database which has already been deployed to Azure. But I am having error "unsupported driver[https]".

My database.php:

<?php

use Illuminate\Support\Str;

return [

    'default' => env('DB_CONNECTION', 'mysql'),

    /

        'mysql' => [
            'driver' => 'mysql'
            'url' => env('DATABASE_URL','https://firstsqlaap.scm.azurewebsites.net/phpMyAdmin/db_structure.php?server=1&db=localdb&token=51b0b3471e798a712e129bcd1ebe5b01'),
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '53082'),
            'database' => env('DB_DATABASE', 'localdb'),
            'username' => env('DB_USERNAME', 'user'),
            'password' => env('DB_PASSWORD', 'pass'),
            
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            
            'options' => extension_loaded('pdo_mysql') ? array_filter([
                PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
            ]) : [],
        ],

];

My SESSION_DRIVER is set to database because when set to file it was saying 419 error. I do not have any migration files as my database is deployed to Azure.

How to resolve this issue?



Solution 1:[1]

This certainly isn't the right URL to use:

https://firstsqlaap.scm.azurewebsites.net/phpMyAdmin/db_structure.php

You appear to be pointing to an instance of phpMyAdmin. phpMyAdmin isn't a database server, it's a dataase client. It's a tool that you might use to interact with your database. You need to provide the URL to your actual database.

Your database URL should look more like this:

driver://username:password@host:port/database?options

For MySQL, driver:// is likely mysql://.

I don't have any MySQL databases running on Azure, but it looks like a real URL might be something like

mysql://user:[email protected]/your-database-name

Go into the Azure portal and navigate to your database instance. Then, in the left navigation panel, click on "Connection strings". The information you need should be there, though not in URL format. You can either build your own URL by plugging the right values in or use the individual settings in your config/database.php file.

Solution 2:[2]

I commented url and it work for me enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 ojoago