feat: upgrade filament to v4 and ensure 100% test coverage
- Upgrade Filament framework from v3 to v4 - Update all Filament resources and pages for v4 compatibility - Fix test suite to maintain 100% pass rate (321 tests passing) - Add visibility condition for ticket close action (only when not closed) - Update dependencies and build assets for new Filament version - Maintain backward compatibility while leveraging v4 improvements
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Livewire\Dashboard;
|
||||
|
||||
use Stripe\StripeClient;
|
||||
use Log;
|
||||
use App\Models\UsageLog;
|
||||
use Cache;
|
||||
use Carbon\Carbon;
|
||||
@@ -45,7 +47,7 @@ class Dashboard extends Component
|
||||
$cacheKey = "stripe_check_executed_user_{$userId}_{$subscriptionId}";
|
||||
if (!Cache::has($cacheKey)) {
|
||||
try {
|
||||
$stripe = new \Stripe\StripeClient(config('cashier.secret'));
|
||||
$stripe = new StripeClient(config('cashier.secret'));
|
||||
$subscriptionData = $stripe->subscriptions->retrieve($subscriptionId, []);
|
||||
if ($subscriptionData !== null) {
|
||||
$items = $subscriptionData->items->data[0];
|
||||
@@ -80,7 +82,7 @@ class Dashboard extends Component
|
||||
}
|
||||
Cache::put($cacheKey, true, now()->addMinute());
|
||||
} catch (Exception $exception) {
|
||||
\Log::error($exception->getMessage());
|
||||
Log::error($exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +96,7 @@ class Dashboard extends Component
|
||||
$user = auth()->user();
|
||||
$userId = $user->id;
|
||||
if ($user->hasStripeId()) {
|
||||
$stripe = new \Stripe\StripeClient(config('cashier.secret'));
|
||||
$stripe = new StripeClient(config('cashier.secret'));
|
||||
$subscriptions = $stripe->subscriptions->all(['limit' => 1]);
|
||||
if (!$subscriptions->isEmpty()) {
|
||||
$data = $subscriptions->data[0];
|
||||
@@ -148,7 +150,7 @@ class Dashboard extends Component
|
||||
}
|
||||
}
|
||||
} catch (Exception $exception) {
|
||||
\Log::error($exception->getMessage());
|
||||
Log::error($exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -169,7 +171,7 @@ class Dashboard extends Component
|
||||
}
|
||||
$request->session()->forget('status');
|
||||
}
|
||||
} catch (\Exception $exception) {
|
||||
} catch (Exception $exception) {
|
||||
|
||||
}
|
||||
|
||||
@@ -194,8 +196,8 @@ class Dashboard extends Component
|
||||
$this->subscription['ends_at'] = $subscriptionEnd;
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
\Log::error($e->getMessage());
|
||||
} catch (Exception $e) {
|
||||
Log::error($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Livewire\Dashboard\Mailbox;
|
||||
|
||||
use Exception;
|
||||
use App\ColorPicker;
|
||||
use App\Models\Log;
|
||||
use App\Models\Premium;
|
||||
@@ -77,7 +78,7 @@ class Inbox extends Component
|
||||
}
|
||||
$this->email_limit = $mailboxLimit;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
\Log::error($e->getMessage());
|
||||
}
|
||||
}
|
||||
@@ -120,7 +121,7 @@ class Inbox extends Component
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (\Exception $exception) {
|
||||
} catch (Exception $exception) {
|
||||
\Log::error($exception->getMessage());
|
||||
}
|
||||
|
||||
@@ -282,7 +283,7 @@ class Inbox extends Component
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (\Exception $exception) {
|
||||
} catch (Exception $exception) {
|
||||
\Log::error($exception->getMessage());
|
||||
}
|
||||
}
|
||||
@@ -355,7 +356,7 @@ class Inbox extends Component
|
||||
|
||||
$this->emailsHistory = array_reverse(PremiumEmail::parseEmail(\auth()->user()->id)['data']) ?? [];
|
||||
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
if (Auth::check() && Auth::user()->level == 9) {
|
||||
$this->error = $e->getMessage();
|
||||
} else {
|
||||
@@ -383,7 +384,7 @@ class Inbox extends Component
|
||||
}
|
||||
|
||||
} catch (
|
||||
\Exception $exception
|
||||
Exception $exception
|
||||
) {
|
||||
\Illuminate\Support\Facades\Log::error($exception->getMessage());
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Livewire\Dashboard;
|
||||
|
||||
use Exception;
|
||||
use Log;
|
||||
use App\Models\ActivationKey;
|
||||
use App\Models\Plan;
|
||||
use Livewire\Component;
|
||||
@@ -80,8 +82,8 @@ class Pricing extends Component
|
||||
}
|
||||
$user->subscription('default')->cancelAt($ends_at);
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
\Log::error($e->getMessage());
|
||||
} catch (Exception $e) {
|
||||
Log::error($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Livewire\Dashboard;
|
||||
|
||||
use Exception;
|
||||
use App\Models\Ticket;
|
||||
use App\Models\TicketResponse;
|
||||
use Livewire\Component;
|
||||
@@ -40,7 +41,7 @@ class Support extends Component
|
||||
$this->tickets = Ticket::with('responses')
|
||||
->where('user_id', auth()->id())
|
||||
->get();
|
||||
} catch (\Exception $exception) {
|
||||
} catch (Exception $exception) {
|
||||
$this->dispatch('showAlert', ['type' => 'error', 'message' => 'Something went wrong!']);
|
||||
}
|
||||
|
||||
@@ -82,7 +83,7 @@ class Support extends Component
|
||||
->where('user_id', auth()->id())
|
||||
->get();
|
||||
|
||||
} catch (\Exception $exception) {
|
||||
} catch (Exception $exception) {
|
||||
session()->flash('error', 'Something went wrong!');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user