Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Commit

Permalink
Instantiate model before call newQueryWithoutTenants
Browse files Browse the repository at this point in the history
Do this to avoid null point exception
  • Loading branch information
nunomazer authored Oct 8, 2019
1 parent b2854ea commit ffa041c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/BelongsToTenants.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ public function getQualifiedTenant($tenant)
*/
public static function allTenants()
{
return static::$landlord->newQueryWithoutTenants(new static());
$model = new static();
return static::$landlord->newQueryWithoutTenants($model);
}

/**
Expand Down

0 comments on commit ffa041c

Please sign in to comment.