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

Call to undefined function VoyagerBread\Commands\studly_case() #11

Open
loooping-old opened this issue Apr 8, 2020 · 2 comments
Open

Comments

@loooping-old
Copy link

I need create migration and seeder for my bread, when I run:

bash-5.0# php artisan voyager:bread my_bread --migration

I have this error

Making BREAD

   Symfony\Component\Debug\Exception\FatalThrowableError  : Call to undefined function VoyagerBread\Commands\studly_case()

  at /var/www/html/vendor/voyager-bread-generator/src/Commands/BreadGenerator.php:104
    100|      * @return string
    101|      */
    102|     protected function getNameInput()
    103|     {
  > 104|         return trim(studly_case($this->argument('name')));
    105|     }
    106| 
    107|     /**
    108|      * Create a migration file for the model.

  Exception trace:

  1   VoyagerBread\Commands\BreadGenerator::getNameInput()
      /var/www/html/vendor/laravel/framework/src/Illuminate/Console/GeneratorCommand.php:54

  2   Illuminate\Console\GeneratorCommand::handle()
      /var/www/html/vendor/voyager-bread-generator/src/Commands/BreadGenerator.php:35

  Please use the argument -v to see more details.
@hasnains
Copy link

I have temporary fixed it:

Replace studly_case() with Str::studly at line no 104 and 129 of file vendor\voyager-bread-generator\src\Commands\BreadGenerator.php

Before:

protected function getNameInput()
    {
        return trim(studly_case($this->argument('name')));
    }

protected function createModel()
    {
        $table = studly_case($this->argument('name'));
        $this->call('make:model', [
            'name' => $table
        ]);
    }

Now:

protected function getNameInput()
    {
        return trim(Str::studly($this->argument('name')));
    }

protected function createModel()
    {
        $table = Str::studly($this->argument('name'));
        $this->call('make:model', [
            'name' => $table
        ]);
    }

@loooping-old
Copy link
Author

Thank you

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