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

exception: Call to undefined function Czim\Repository\Console\Commands\str_singular() #23

Open
mysic opened this issue Aug 30, 2022 · 1 comment

Comments

@mysic
Copy link

mysic commented Aug 30, 2022

hello
when I ran the command "php artisan make:repository SomethingRepository" ,and catched the exception info.

my env is :
Laravel Framework 6.20.44
czim/laravel-repository 2.0.2

  at /xxx/vendor/czim/laravel-repository/src/Console/Commands/MakeRepositoryCommand.php:159                                                                                                 
    155| 
    156|             $repositoryClass = str_replace($this->getNamespace($name) . '\\', '', $name);
    157|             $class           = str_replace($this->suffix, '', $repositoryClass);
    158| 
  >159|             $modelClass = str_singular($class);
    160|         }
    161| 
    162|         // Append the expected models namespace if not namespaced yet
    163|         if (false === strpos($modelClass, '\\')) {

it's better to change the str_singular($class) to Str::singular($class)

@czim
Copy link
Owner

czim commented Aug 30, 2022

I don't really support this legacy package anymore. Your best bet it is to upgrade so you can use package version 3.0.0.
If you want to submit a PR for an older version, that is welcome too of course.

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

2 participants