CRUD: [Bug] Method Backpack\CRUD\app\Library\CrudPanel\CrudPanel::addViewNamespaceFor does not exist.

Bug report

What I did

Updated via Composer

What I expected to happen

Backpack/crud to update to latest version.

What happened

Update failed:

 BadMethodCallException                                                                                       
                                                                                                              
Method Backpack\CRUD\app\Library\CrudPanel\CrudPanel::addViewNamespaceFor does not exist.                     
                                                                                                              
at C:\laragon\www\kpbp\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▕                                                                                                        
                                                                                                              
i   Bad Method Call: Did you mean Backpack\CRUD\app\Library\CrudPanel\CrudPanel::getFieldTypeWithNamespace() ?
                                                                                                              
1   C:\laragon\www\kpbp\vendor\backpack\pro\src\AddonServiceProvider.php:19                                   
    Backpack\CRUD\app\Library\CrudPanel\CrudPanel::__call("addViewNamespaceFor")                              
                                                                                                              
2   C:\laragon\www\kpbp\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:36                  
    Backpack\Pro\AddonServiceProvider::boot()   

What I’ve already tried to fix it

Going back to backpack/crud v 5.3.6 avoids the problem.

Is it a bug in the latest version of Backpack?

Happens every time I try to update past v 5.3.6.

Backpack, Laravel, PHP, DB version

When I run php artisan backpack:version with any version of backpack over 5.3.6 the output error is the same as above.

LARAVEL VERSION: 9.27.0

BACKPACK PRO VERSION: 1.2.1 (Possibly relevant? I can’t update past this for now)

PHP VERSION: 8.0.13

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

No worries… I’d have noticed this myself if I was paying attention 😁

It’s working now.

Thanks both for your assistance here!

its-not-your-fault-supportive

Hey @michug that does not seem like the same error.

It looks like somewhere in your code you are calling CRUD::resource() or something, instead of Route::crud()

search your project where you are calling that and correct it. It should work just fine.

Cheers

My bad @sng82 ! it’s 5.3.99, not 3.5.99.

composer require backpack/crud:"dev-work-around-for-specific-crud-versions as 5.3.99"