Added Fetch Email on page load
This commit is contained in:
@@ -65,7 +65,8 @@ class Action extends Component
|
||||
$this->dispatch('closeModal');
|
||||
}
|
||||
|
||||
public function deleteEmail() {
|
||||
public function deleteEmail(): void
|
||||
{
|
||||
ZEmail::removeEmail($this->email);
|
||||
// if (count($this->emails) <= 1 && json_decode(config('app.settings.configuration_settings'))->after_last_email_delete == 'redirect_to_homepage') {
|
||||
// return redirect()->route('home');
|
||||
@@ -82,7 +83,8 @@ class Action extends Component
|
||||
$this->dispatch('showAlert', ['type' => $type, 'message' => $message]);
|
||||
}
|
||||
|
||||
private function checkEmailLimit() {
|
||||
private function checkEmailLimit(): bool
|
||||
{
|
||||
$logs = Log::select('ip', 'email')->where('ip', request()->ip())->where('created_at', '>', Carbon::now()->subDay())->groupBy('email')->groupBy('ip')->get();
|
||||
if (count($logs) >= json_decode(config('app.settings.configuration_settings'))->email_limit) {
|
||||
return false;
|
||||
@@ -90,7 +92,8 @@ class Action extends Component
|
||||
return true;
|
||||
}
|
||||
|
||||
private function checkUsedEmail() {
|
||||
private function checkUsedEmail(): bool
|
||||
{
|
||||
if (json_decode(config('app.settings.configuration_settings'))->disable_used_email) {
|
||||
$check = Log::where('email', $this->user . '@' . $this->domain)->where('ip', '<>', request()->ip())->count();
|
||||
if ($check > 0) {
|
||||
|
||||
Reference in New Issue
Block a user