Fix dislpay of mb file upload size
This commit is contained in:
@@ -133,6 +133,7 @@ class Form extends Model implements CachableAttributes
|
||||
protected $cachableAttributes = [
|
||||
'is_pro',
|
||||
'views_count',
|
||||
'max_file_size'
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -234,6 +235,13 @@ class Form extends Model implements CachableAttributes
|
||||
return !empty($this->password);
|
||||
}
|
||||
|
||||
public function getMaxFileSizeAttribute()
|
||||
{
|
||||
return $this->remember('max_file_size', 15 * 60, function(): int {
|
||||
return $this->workspace->max_file_size;
|
||||
});
|
||||
}
|
||||
|
||||
protected function removedProperties(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
|
||||
@@ -14,9 +14,7 @@ class Workspace extends Model implements CachableAttributes
|
||||
|
||||
const MAX_FILE_SIZE_FREE = 5000000; // 5 MB
|
||||
const MAX_FILE_SIZE_PRO = 50000000; // 50 MB
|
||||
|
||||
const MAX_DOMAIN_PRO = 1;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'icon',
|
||||
|
||||
Reference in New Issue
Block a user