orchestral / tenanti

[Package] Multi-tenant Database Schema Manager for Laravel
MIT License
588 stars 52 forks source link

Error while trying to execute "php artisan tenanti:install account" #39

Closed gabrielbuzziv closed 7 years ago

gabrielbuzziv commented 7 years ago
public function boot()
    {
        Tenanti::connection('account', function (Account $account, array $config) {
            $config['database'] = "saas_{$account->slug}";

            return $config;
        });
    }

For some reason this resolver is throwing the error below:

Argument 2 passed to App\Providers\AppServiceProvider::App\Providers\{closure}() must be of the type array, object given 
crynobone commented 7 years ago

Which Laravel version?

BTW, the first parameter is required to be set to $entity, we're using Illuminate\Container\Container::call() method here, and we already bind the relevant model to $entity, Defining Account $account would mean the container would then build a new Account object.

gabrielbuzziv commented 7 years ago

Change to $entity solved this problem, thanks.