chore: migrate to unified payment system & fix disposable gmail and outlook
This commit is contained in:
@@ -2,10 +2,6 @@
|
||||
|
||||
namespace App\Livewire\Dashboard\Mailbox;
|
||||
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use Illuminate\Routing\Redirector;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use App\ColorPicker;
|
||||
use App\Models\Log;
|
||||
use App\Models\Premium;
|
||||
@@ -13,7 +9,11 @@ use App\Models\PremiumEmail;
|
||||
use App\Models\UsageLog;
|
||||
use App\Models\ZEmail;
|
||||
use Exception;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Routing\Redirector;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use Livewire\Component;
|
||||
|
||||
class Inbox extends Component
|
||||
@@ -82,7 +82,7 @@ class Inbox extends Component
|
||||
|
||||
$this->emailsHistory = array_reverse(PremiumEmail::parseEmail(\auth()->user()->id)['data']) ?? [];
|
||||
|
||||
$subscriptionCheck = auth()->user()->subscribedToProduct(config('app.plans')[0]['product_id']);
|
||||
$subscriptionCheck = auth()->user()->hasActiveSubscription();
|
||||
Session::put('isSubscribed', $subscriptionCheck);
|
||||
if ($subscriptionCheck) {
|
||||
try {
|
||||
@@ -245,6 +245,7 @@ class Inbox extends Component
|
||||
private function checkEmailLimit(): bool
|
||||
{
|
||||
$logs = Log::query()->select('ip', 'email')->where('user_id', auth()->user()->id)->where('created_at', '>', Date::now()->subDay())->groupBy('email')->groupBy('ip')->get();
|
||||
|
||||
return count($logs) < $this->email_limit;
|
||||
}
|
||||
|
||||
@@ -252,6 +253,7 @@ class Inbox extends Component
|
||||
{
|
||||
if (json_decode((string) config('app.settings.configuration_settings'))->disable_used_email) {
|
||||
$check = Log::query()->where('email', $this->user.'@'.$this->domain)->where('ip', '<>', request()->ip())->count();
|
||||
|
||||
return $check <= 0;
|
||||
}
|
||||
|
||||
@@ -430,6 +432,7 @@ class Inbox extends Component
|
||||
if (Session::get('isSubscribed')) {
|
||||
return view('livewire.dashboard.mailbox.inbox')->layout('components.layouts.dashboard');
|
||||
}
|
||||
|
||||
return view('livewire.dashboard.not-subscribed')->layout('components.layouts.dashboard');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user