tenancy: Exception: get_class() expects parameter 1 to be object, null given

I’m using the Laravel IDE Helper package. I get the exception in the issue title when I run artisan ide-helper:generate

It can be fixed in Stancl\Tenancy\Facades\TenantFacade doing this:

class TenantFacade extends Facade
{
    protected static function getFacadeAccessor()
    {
        // return Tenant::class;

        // return hardcoded string instead of getting the name from the class
        return '\Stancl\Tenancy\Tenant';
    }
    // ...
}

But I’m not sure whats going on…

Setup

  • Laravel version: 7.5.2
  • stancl/tenancy version: 2.3.4
  • Storage driver: MySQL

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 18 (18 by maintainers)

Most upvoted comments

They have a ton of open PRs, but I submitted the fix anyway: https://github.com/barryvdh/laravel-ide-helper/pull/916