DEV Community

Cover image for Laravel - Class "Illuminate\Database\Console\ShowModelCommand" not found Solved
Arman Rahman
Arman Rahman

Posted on

Laravel - Class "Illuminate\Database\Console\ShowModelCommand" not found Solved

While Installing Laravel Module Package sometime you may have issue with Class "Illuminate\Database\Console\ShowModelCommand" not found So Here is the Solve!

composer require nwidart/laravel-modules

Class App\Http\Requests\settings\MessageSentRequest located in C:/laragon/www/codebit/app\Http\Requests\Settings\MessageSentRequest.php does not comply with psr-4 autoloading standard. Skipping.                                                                                                                                                                              
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   Error

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

  at C:\laragon\www\codebit\vendor\nwidart\laravel-modules\src\Commands\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▕      *

  1   C:\laragon\www\codebit\vendor\composer\ClassLoader.php:576
      include()

  2   C:\laragon\www\codebit\vendor\composer\ClassLoader.php:427
      Composer\Autoload\{closure}("C:\laragon\www\codebit\vendor\composer/../nwidart/laravel-modules/src/Commands/ModelShowCommand.php")
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
Enter fullscreen mode Exit fullscreen mode

If you face this issue then you have to search

vendor\nwidart\laravel-modules\src\Commands\ModelShowCommand.php

File on your project. Then Replace two lines -

namespace Nwidart\Modules\Commands;

use Illuminate\Database\Console\ShowCommand;
use Symfony\Component\Console\Attribute\AsCommand;

#[AsCommand('module:model-show', 'Show information about an Eloquent model in modules')]
class ModelShowCommand extends ShowCommand
{

Enter fullscreen mode Exit fullscreen mode

Image description

Hope this will help you! Thak You

Top comments (0)