devit chea
devit chea

Reputation: 53

Laravel 8 + backpack error on "php artisan backpack:crud-operation SendNotification"

I installed Laravel 8 with backpack 5.1 and I run php artisan backpack:crud-operation SendNotification I got error:

root@9139092f4397:/var/www/khm-hrms# php artisan backpack:crud-operation SendNotification

   BadMethodCallException 

  Method Illuminate\Support\Stringable::lcfirst does not exist.

  at vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:113
    109▕      */
    110▕     public function __call($method, $parameters)
    111▕     {
    112▕         if (! static::hasMacro($method)) {
  ➜ 113▕             throw new BadMethodCallException(sprintf(
    114▕                 'Method %s::%s does not exist.', static::class, $method
    115▕             ));
    116▕         }
    117▕ 

  • Bad Method Call: Did you mean Illuminate\Support\Stringable::ucfirst() ? 

      +16 vendor frames 
  17  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()

Does anyone know what the issue might be ? I cannot find a solution online.

Upvotes: 0

Views: 725

Answers (2)

Pedro X
Pedro X

Reputation: 1071

You should update Backpack package like Hefaz suggested. The version you got has that error and you need to bump your version to get the fix, your PHP and Laravel versions are fine.

composer update backpack/crud.

We are currently on 5.4. If it says nothing to updade, please check your composer.json to make sure you are not forcing the breaking version there, you should be fine with: backpack/crud: ^5.0 as we don't push breaking changes in minor versions. (bugs sometimes, but not breaking changes hehe :-D )

Cheers

Upvotes: 0

Hefaz
Hefaz

Reputation: 671

lcfirst is used as part of Laravel Str::class. Read more here.

Look at this issue: https://github.com/Laravel-Backpack/Generators/pull/149

You can update your package to the latest version, and this should be solved.

Upvotes: 1

Related Questions