Laravel-Backpack / CRUD

Build custom admin panels. Fast!
https://backpackforlaravel.com
MIT License
3.16k stars 893 forks source link

[Feature Request] CRUD field type - phone #1202

Closed chriscalip closed 5 years ago

chriscalip commented 6 years ago

Who wants it? Can we have it?

Possible libraries for this feature request.

https://github.com/jackocnr/intl-tel-input https://github.com/iPublikuj/form-phone

indra1 commented 6 years ago

@chriscalip just add your own field in resources/view/vendor/backpack/crud/fields. and if you think you nailed it maybe do a pr?

I added scopes to my select2 fields using this method and it was super easy. Now i'm looking into a way to add scopes using a closure in order to do a pr.

tabacitu commented 6 years ago

Hi @chriscalip ,

phone sounds like a good new field to me, and the JS package you linked looks nice, is MIT-licensed, keyboard-friendly and solidly written and supported, so I think we can totally use it.

I don't know if we can/should complicate the field with server-side validation. IMHO that's up to the developer. For example, I myself would prefer to use Propaganistas/Laravel-Phone for validation. I think it would be easier to just add the field type (phone.blade.php), and mention in the docs the possible validation packages the developer can use.

Let's leave this open. Not a priority for the core team, but if anybody needs this and creates a PR, happy to merge it.

Cheers!

tabacitu commented 5 years ago

Cleaning up the issues section before I go on a merging spree for 4.0. I'm going to close this since we already have a working PR for it here - https://github.com/Laravel-Backpack/CRUD/pull/1408

Let's move the conversation there. Thanks a lot @chriscalip !