Set default value for company_id to fix seeder

This commit is contained in:
snipe
2015-11-26 14:11:56 -08:00
parent 7d2ae0d10d
commit 078750726f
+5 -1
View File
@@ -18,7 +18,11 @@ final class Company extends Elegant
private static function scopeCompanyablesDirectly($query, $column = 'company_id')
{
$company_id = Sentry::getUser()->company_id;
if (Sentry::getUser()) {
$company_id = Sentry::getUser()->company_id;
} else {
$company_id = NULL;
}
if ($company_id == NULL) { return $query; }
else { return $query->where($column, '=', $company_id); }