tenancy / multi-tenant

Run multiple websites using the same Laravel installation while keeping tenant specific data separated for fully independent multi-domain setups, previously github.com/hyn/multi-tenant
https://tenancy.dev
MIT License
2.56k stars 394 forks source link

TypeError Return value of Hyn\Tenancy\Database\Connection::configuration() must be of the type array, null returned #953

Open jonquintero opened 4 years ago

jonquintero commented 4 years ago

When I try to create a new tenant appears this error

jonquintero commented 4 years ago

This error is because in this file vendor\hyn\multi-tenant\src\Database\Connection.php in this method

    public function configuration(string $connection = null): array
    {
        $connection = $connection ?? $this->tenantName();

        return $this->config->get(
            sprintf('database.connections.%s', $connection),
            []
        );
    }

Is declared a return type declaration : array, removing the type of declaration it's work

    public function configuration(string $connection = null)
    {
        $connection = $connection ?? $this->tenantName();

        return $this->config->get(
            sprintf('database.connections.%s', $connection),
            []
        );
    }

please fix it

fletch3555 commented 4 years ago

This is a symptom of your configuration being incorrect, not an issue with the package itself. If this is still a problem for you, please provide the information requested in the issue template