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

Custom Rule classes not working #580

Open
KuenzelIT opened this issue Oct 30, 2018 · 1 comment
Open

Custom Rule classes not working #580

KuenzelIT opened this issue Oct 30, 2018 · 1 comment

Comments

@KuenzelIT
Copy link
Contributor

Hi!

This seems like dumb question, but are custom rule classes supported by Former?

I'm getting the following error when I try to pass my form request rules to Former:

strpos() expects parameter 1 to be string, object given

This happens in the Former.php file on line 315:

foreach ($expFieldRules as $rule) {
    $parameters = null;
 
    if (($colon = strpos($rule, ':')) !== false) {   // <-------------------
         $rulename = substr($rule, 0, $colon);
...
}

To me it seems like there's a check on rule objects missing.

Thanks!

@stayallive
Copy link
Contributor

It is correct they currently give an error when used, they are indeed not supported by Former.

For now we will prevent errors (after #592 is merged) when passing Rule objects and in the future it's possible Former will support Rule classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants