cuonggt / laravel-dibi

An elegant GUI database management tool for your Laravel applications.
MIT License
47 stars 8 forks source link

[BUG] Error Composer Install with Custom Database Connection Name #22

Closed fauzie closed 3 years ago

fauzie commented 3 years ago

I am using mysql driver with custom connection name (not mysql). my config/database.php

    'default' => 'mydb',
    'connections' => [
       'mydb' => [
           'driver' => 'mysql',
           .....

Just installing with composer require cuonggt/laravel-dibi And show this error on shell, and installation failed.

In DibiServiceProvider.php line 67:

  Database driver [] is not supported.  

It is because of laravel auto discovery, i did a trick to add cuonggt/laravel-dibi to dont-discover in composer.json But still i need to install manual, copy a provider & config files.

it was strange to check database connection on service provider registration :cry:

cuonggt commented 3 years ago

Hi @fauzie

Based on the information you provide, I think you'll need to specify the DIBI_DB_CONNECTION value to point to your database connection name in your .env file.

For example, in your case, add to the .env file:

DIBI_DB_CONNECTION=mydb