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

Error on MigrationCommand.php: count() #58

Open
gemins opened this issue Feb 19, 2018 · 3 comments
Open

Error on MigrationCommand.php: count() #58

gemins opened this issue Feb 19, 2018 · 3 comments

Comments

@gemins
Copy link

gemins commented Feb 19, 2018

Hello, i try to create one model with method wn:resources and get this error:
In MigrationCommand.php line 118:
count(): Parameter must be an array or an object that implements Countable

I check the MigrationCommnand.php file and change the method count by strlen and this work fine.

I hope can you update the repo with this fix to the next version (i have 1.3.4v).

Bye!

@danielmmf
Copy link

    if(is_array($key['name'])){
       if(! $key['table']){
            $key['table'] = str_plural(substr($key['name'], 0, count($key['name']) - 4));
        } 
    }else{
        if(! $key['table']){
            $key['table'] = str_plural(substr($key['name'], 0, 1 - 4));
        } 
    }

@danielmmf
Copy link

Hello, i try to create one model with method wn:resources and get this error:
In MigrationCommand.php line 118:
count(): Parameter must be an array or an object that implements Countable

I check the MigrationCommnand.php file and change the method count by strlen and this work fine.

I hope can you update the repo with this fix to the next version (i have 1.3.4v).

Bye!

This is da right way !!!

ryanrapini added a commit to ryanrapini/lumen-generators that referenced this issue Jun 3, 2019
@ryanrapini
Copy link

This fixed it, this project seems to be abandoned, so I forked it and delivered your change.

https://github.com/ryanrapini/lumen-generators

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

No branches or pull requests

3 participants