Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make formatting available on detail and index views. #9

Open
dniccum opened this issue Nov 5, 2018 · 2 comments
Open

Make formatting available on detail and index views. #9

dniccum opened this issue Nov 5, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@dniccum
Copy link
Owner

dniccum commented Nov 5, 2018

Just wondering - would it not be better to not change that format? If a database is configured a certain way with certain lengths this can pose a problem. Currently nova is relatively new and as it becomes more widely adopted I believe it would pose a bigger issue.

I would suggest that the format is not applied on setter but on a getter and input only. Leaving the database table format as is and using the format visually. What are your thoughts on this? That would make your nova field be more aesthetic and maybe have a save-with-format option that will write to database if needed.

Originally posted by @johnpaulmedina in #4 (comment)

@dniccum dniccum added the enhancement New feature or request label Nov 5, 2018
@dniccum
Copy link
Owner Author

dniccum commented Nov 5, 2018

@johnpaulmedina That is an interesting request. I will have to take a look at this. The behavior that is currently implemented appears to be a common practice with a lot of the Nova fields that I have used. With that said, I can see where having the type of implementation that you have requested would be valuable.

@perforsberg77
Copy link

I just wondered if it would be better to store the number in the database in E.164 format (0701234567) for all countries and use countrybased format when displaying the number (070-123 45 67) for sweden for example?

I use this now

PhoneNumber::make('Phone Number')
->format('###-### ## ##')
->country('SE'),

And for me the number is stored just like that 070-123 45 67. I think I would like it to be better if it was stored 0701234567. Or am I wrong?

It would be nice if the country code (+46) could be added in some way. I use the country field to store country code in a separate column at the moment, but if the user doesn´t enter the country code I don´t know where to get that from?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants