This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

billyZduke
billyZduke

I don't see this anywhere else in here, so here goes: I would like to add a phone number validator for the user.phone field. I found this:

https://github.com/Propaganistas/Laravel-Phone

But just putting that in my vendor directory doesn't do anything, and attempting to include the provider in app.php just crashes everything, as the new vendor path does not seem to be included. I haven't really been using composer when dealing with October, so changing my composer.json, as the above link recommends, also does nothing. It's not an OctoberCMS plugin, so it doesn't make sense to me to attempt to move the whole src into the plugins directory...

So, what, exactly, should I do here?

Crazymodder
philipptempel
philipptempel

1) Add the package according to its installation instructions 2) Follow the instructions in the doc on how to add service providers 3) Use the validation method as defined in its readme 3a) if for some reason 3) does not work, try a custom validation rule that is just a wrapper for Propaganistas validator. 3b) or report back here

billyZduke
billyZduke

Well, I got this working by adding a composer.json to my plugin and running composer update. The only problem now is it downloaded a ton of dependent packages into my plugin's vendor folder, some of which, like the ones from symfony & illuminate, I'm sure are already present in the OctoberCMS vendor folder... Deleting the downloaded dupes causes breakage. How can I get my plugin to use existing vendor packages where applicable, so I can keep the plugin vendor folder as small as possible?

Crazymodder
Crazymodder

Composer has added this feature:

https://github.com/composer/composer/issues/1426

--ignore-platform-reqs

1-5 of 5

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.