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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user