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

[Bug]: Class "App\Models\Traits\Arr" does not exist #1

Open
rabol opened this issue Feb 10, 2024 · 0 comments
Open

[Bug]: Class "App\Models\Traits\Arr" does not exist #1

rabol opened this issue Feb 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@rabol
Copy link

rabol commented Feb 10, 2024

What happened?

Installed and executed

php artisan update:fillable
 ReflectionException 

  Class "App\Models\Traits\Arr" does not exist

  at vendor/jrbarros/laravel-update-fillable/src/LaravelUpdateFillableUpdater.php:298
    294▕                 if (! $className) {
    295▕                     continue;
    296▕                 }
    297▕ 
  ➜ 298▕                 $reflection = new ReflectionClass($className);
    299▕ 
    300▕                 if ($reflection->isSubclassOf(Model::class) && ! $reflection->isAbstract()) {
    301▕                     $models[] = $className;
    302▕                 }

      +15 vendor frames 

  16  artisan:35
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))


How to reproduce the bug

Install and execute

Package Version

0.0.4

PHP Version

8.3.2

Laravel Version

10.43.0

Which operating systems does with happen with?

macOS

Notes

I have a Traits folder in my Models folder, but all references to Arr is solved with a

use

I added this:

try {
                    $reflection = new ReflectionClass($className);

                    if ($reflection->isSubclassOf(Model::class) && ! $reflection->isAbstract()) {
                        $models[] = $className;
                    }

                }
                catch (\ReflectionException $exception)
                {
                    Log::error($className);
                }

not sure why this package tries to process

 App\Models\Traits\Arr  
@rabol rabol added the bug Something isn't working label Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant