0

after I've tried to update all the dependencies of our laravel installation (which started from 5.8) all the way to laravel 9 I'm recently having issues when doing the composer update with the nwidart/laravel-modules.

The error I'm getting is the following:

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

  at vendor/nwidart/laravel-modules/src/Commands/ModelShowCommand.php:7
      3▕ namespace Nwidart\Modules\Commands;
      4▕ 
      5▕ use Illuminate\Foundation\Console\ShowModelCommand;
      6▕ 
  ➜   7▕ class ModelShowCommand extends ShowModelCommand
      8▕ {
      9▕ 
     10▕ 
     11▕     /**

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

      +7 vendor frames 
  11  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

does anyone know how to solve it ?

tried using other versions of the same module but nothing..

Joey
  • 19
  • 3

3 Answers3

2

The command composer require nwidart/laravel-modules:9.0 installs the latest version of nwidart/laravel-modules package for Laravel 9.0

Mahdi
  • 21
  • 2
1

I have facing same issue. Look like ShowModelCommand only exists with Laravel 10. https://laravel.com/api/10.x/Illuminate/Database/Console/ShowModelCommand.html and Modules version 10 install automatically with composer require nwidart/laravel-modules

Try w/ composer require nwidart/laravel-modules "9.*" and it will work.

Laravel laravel-modules
5.4 ^1.0
5.5 ^2.0
5.6 ^3.0
5.7 ^4.0
5.8 ^5.0
6.0 ^6.0
7.0 ^7.0
8.0 ^8.0
9.0 ^9.0
10.0    ^10.0
Viet Vu
  • 41
  • 1
  • 1
  • 4
0

I have the same problem and this is for laravel updated to version 10 and nwidart/laravel-modules doesn't compatible with that so easily you can run composer require nwidart/laravel-modules:9.0 to solve temporary your problem:)

Rohit Gupta
  • 4,022
  • 20
  • 31
  • 41
Younes
  • 1