Add the option to choose a dynamic billing period.#1309
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to implement issue #1285 by introducing a per-deployment billing period selection and refactoring products to use a “default billing period” (instead of a single hardcoded product billing period).
Changes:
- Add
BillingPeriodenum and introduceproducts.default_billing_period(int-backed) as the new default period field. - Add
servers.billing_periodto allow overriding billing period at deployment time. - Update admin/product and server creation UI to use/display the new default billing period fields.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| themes/default/views/servers/create.blade.php | Adds billing period selector to server creation and adjusts displayed billing period label. |
| themes/default/views/admin/products/index.blade.php | Renames billing period column and switches datatable field to default_billing_period. |
| themes/default/views/admin/products/edit.blade.php | Replaces legacy billing_period select with enum-driven default_billing_period. |
| themes/default/views/admin/products/create.blade.php | Same as edit form: enum-driven default_billing_period selection. |
| database/migrations/2026_02_08_094845_add_billing_period_column_to_servers_table.php | Adds nullable servers.billing_period. |
| database/migrations/2026_02_08_094217_drop_billing_period_column_of_products_table.php | Drops legacy products.billing_period column (and recreates on rollback). |
| database/migrations/2026_02_08_084601_add_default_billing_period_column_to_products_table.php | Adds products.default_billing_period and attempts to backfill from legacy values. |
| app/Models/Server.php | Adds billing_period to $fillable for activity logging / mass assignment. |
| app/Models/Product.php | Adds enum cast + appended label attribute for default_billing_period. |
| app/Http/Controllers/ServerController.php | Validates and stores billing_period on created servers. |
| app/Http/Controllers/Admin/UserController.php | Fixes missing braces in exception handling. |
| app/Http/Controllers/Admin/ProductController.php | Validates default_billing_period and exposes it via datatable. |
| app/Enums/BillingPeriod.php | New int-backed enum with labels/descriptions/options. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… control which billing periods the customer can choose.
|
Hi! If I reviewed the pull request correctly, there's no option to enable/disable the ability to select a custom payment period. For example, if an administrator wants to create one plan with a fixed payment period and a second plan with custom periods, I think an on/off option would be very useful |
|
@Ferks-FK status? |
f797f1d to
43325dd
Compare
8650200 to
32334b0
Compare
implements #1285.