Add the ability to choose the currency symbol#280
Add the ability to choose the currency symbol#280PatBriPerso wants to merge 4 commits intothedevdojo:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for custom currency symbols in billing plans to enable pricing in different currencies like euros (€). The implementation adds a new currency column to the plans table and updates the UI to display the configurable currency symbol instead of the hardcoded dollar sign.
Key changes:
- Added database migration to include a
currencycolumn in the plans table with a default value of '$' - Updated Blade templates to display the plan's currency symbol instead of hardcoded '$'
- Enhanced the Filament admin interface to allow editing and viewing the currency field
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| wave/database/migrations/2025_10_14_143501_add_currency_column.php | Adds currency column to plans table with '$' default |
| wave/resources/views/livewire/billing/checkout.blade.php | Replaces hardcoded '$' with dynamic currency symbol |
| resources/themes/anchor/components/marketing/sections/pricing.blade.php | Updates pricing display to use plan's currency |
| app/Filament/Resources/Plans/PlanResource.php | Adds currency field to admin form and table view |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
wave/database/migrations/2025_10_14_143501_add_currency_column.php
Outdated
Show resolved
Hide resolved
| TextInput::make('currency') | ||
| ->maxLength(191), |
There was a problem hiding this comment.
The currency field should have input validation to ensure only valid currency symbols are entered. Consider adding a validation rule or using a Select component with predefined currency options.
| TextInput::make('currency') | |
| ->maxLength(191), | |
| Select::make('currency') | |
| ->options([ | |
| 'USD' => 'USD', | |
| 'EUR' => 'EUR', | |
| 'GBP' => 'GBP', | |
| 'AUD' => 'AUD', | |
| 'CAD' => 'CAD', | |
| 'JPY' => 'JPY', | |
| 'CHF' => 'CHF', | |
| 'CNY' => 'CNY', | |
| 'INR' => 'INR', | |
| // Add more as needed | |
| ]) | |
| ->searchable() | |
| ->required(), |
There was a problem hiding this comment.
@bobbyiliev, it could be a good idea to have a currency list but with symbols not the 3 letters codes.
Before I do this PR, I see Laravel libs that has all the world currency symbols but it seems to be too much imo (100+ currencies).
To keep it simple, I can just add a few symbols like $, €, £ and ¥. What do you think?
I can also, may be, reduce the size of the column to 1 character (or 3 if we put the code later). What do you think?
….php Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
tnylea
left a comment
There was a problem hiding this comment.
This looks great! I'll be reviewing today and tomorrow to do a final check and get this merged in. Appreciate it @PatBriPerso
|
I push 2 more commits:
|
|
Hi @tnylea Do you need I do something to merge and close this PR? |
I need to have billing plans in euro (€) so I add a currency symbol for each plan in the database.