lumen-generators icon indicating copy to clipboard operation
lumen-generators copied to clipboard

Error on MigrationCommand.php: count()

Open gemins opened this issue 7 years ago • 3 comments

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!

gemins avatar Feb 19 '18 00:02 gemins

    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 avatar Sep 17 '18 06:09 danielmmf

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 !!!

danielmmf avatar Sep 17 '18 06:09 danielmmf

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

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

ryanrapini avatar Jun 03 '19 14:06 ryanrapini