nWidart / laravel-modules

Module Management In Laravel
https://docs.laravelmodules.com
MIT License
5.5k stars 954 forks source link

Package Installtion Fails Due To "ShowModelCommand" Not Found. Seems to be Looking in Wrong Location. #1870

Closed FireOpsPhil closed 3 months ago

FireOpsPhil commented 3 months ago

When I try to install the package, I get the folowing error at the console:

 Error 

  Class "Illuminate\Database\Console\ShowModelCommand" not found

  at vendor/nwidart/laravel-modules/src/Commands/Actions/ModelShowCommand.php:9
      5▕ use Illuminate\Database\Console\ShowModelCommand;
      6▕ use Symfony\Component\Console\Attribute\AsCommand;
      7▕ 
      8▕ #[AsCommand('module:model-show', 'Show information about an Eloquent model in modules')]
  ➜   9▕ class ModelShowCommand extends ShowModelCommand
     10▕ {
     11▕     /**
     12▕      * The console command name.
     13▕      *

      +2 vendor frames 
  3   [internal]:0
      Composer\Autoload\ClassLoader::loadClass("Nwidart\Modules\Commands\Actions\ModelShowCommand")

      +7 vendor frames 
  11  artisan:35
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

In my Laravel application, the "ShowModelCommand" appears to be located at: vendor/laravel/framework/src/Illuminate/Foundation/Console/ShowModelCommand.php, not at: vendor/laravel/framework/src/Illuminate/Database/Console/ShowModelCommand.php

dcblogdev commented 3 months ago

Are you by chance trying to install version 11 on laravel 10?

If so use version 10 or upgrade laravel to version 11

FireOpsPhil commented 3 months ago

@dcblogdev was correct. My error. Sorry.