mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-28 19:10:40 +00:00
restriction text implementation for the frontend
This commit is contained in:
@@ -3,6 +3,7 @@ namespace App\Users\Models;
|
||||
|
||||
use ByteUnits\Metric;
|
||||
use Illuminate\Support\Str;
|
||||
use BadMethodCallException;
|
||||
use Domain\Files\Models\File;
|
||||
use Domain\Folders\Models\Folder;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
@@ -196,10 +197,14 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||
|
||||
public function __call($method, $parameters)
|
||||
{
|
||||
if (str_starts_with($method, 'can') || str_starts_with($method, 'get')) {
|
||||
return resolve(RestrictionsManager::class)
|
||||
->driver()
|
||||
->$method($this, ...$parameters);
|
||||
try {
|
||||
if (str_starts_with($method, 'can') || str_starts_with($method, 'get')) {
|
||||
return resolve(RestrictionsManager::class)
|
||||
->driver()
|
||||
->$method($this, ...$parameters);
|
||||
}
|
||||
} catch (BadMethodCallException $e) {
|
||||
return parent::__call($method, $parameters);
|
||||
}
|
||||
|
||||
return parent::__call($method, $parameters);
|
||||
|
||||
@@ -70,13 +70,13 @@ class MeteredBillingRestrictionsEngine implements RestrictionsEngine
|
||||
{
|
||||
if ($this->getDunningSequenceCount($user) === 3) {
|
||||
return match ($user->dunning->type) {
|
||||
'limit_usage_in_new_accounts' => 'Please make your first payment.',
|
||||
'usage_bigger_than_balance' => 'Please increase your account balance.',
|
||||
'limit_usage_in_new_accounts' => 'Please make your first payment to cover your usage.',
|
||||
'usage_bigger_than_balance' => 'Please increase your account balance higher than your monthly usage.',
|
||||
};
|
||||
}
|
||||
|
||||
if (! $this->checkFailedPayments($user)) {
|
||||
return 'Please update your credit card.';
|
||||
return 'Please update your credit card to pay your usage.';
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user