You've already forked Epicnabbo-Catalogus-Updated-Daily
🆙 Forget data back 🆙
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Rules;
|
||||
|
||||
use App\Models\Miscellaneous\WebsiteBetaCode;
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Validation\InvokableRule;
|
||||
|
||||
class BetaCodeRule implements InvokableRule
|
||||
{
|
||||
public function __invoke(string $attribute, mixed $value, Closure $fail)
|
||||
{
|
||||
if (setting('requires_beta_code') && WebsiteBetaCode::whereCode($value)->whereNull('user_id')->doesntExist()) {
|
||||
$fail(__('The beta code is invalid.'));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user