Skip to content

Conversation

@PatBriPerso
Copy link
Contributor

My real use case

I start my SaaS web site with 2 plans and a few months later I want to add a new plan in the middle.
When I create the new plan it was at the end (at right) of the plans list. I cannot change the plan IDs for the
two first plans because they already have been bought by real customers.

My solution

I add a sort_order column to the plans table and sort plans based
on this column.

@bobbyiliev bobbyiliev requested review from Copilot and tnylea and removed request for tnylea October 15, 2025 09:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for explicitly ordering billing plans without changing existing plan IDs.

  • Introduces sort_order column and applies ordering in Plan::getActivePlans
  • Updates UI components (checkout, pricing, Filament resource) to use centralized retrieval and expose sort_order
  • Adds migration and admin form/table adjustments for managing and displaying sort order

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
wave/src/Plan.php Adds ordering by sort_order to active plan retrieval
wave/src/Http/Livewire/Billing/Checkout.php Switches to centralized getActivePlans method
wave/database/migrations/2025_10_14_113035_add_sort_order_column.php Adds sort_order column (with down logic)
resources/themes/anchor/components/marketing/sections/pricing.blade.php Uses new ordered active plans accessor
app/Filament/Resources/Plans/PlanResource.php Adds form input and table column for sort_order with default sort

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@bobbyiliev bobbyiliev requested a review from tnylea October 19, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant