MoSalem's avatar

Trait "Illuminate\Console\Prohibitable" not found

Hello

When i tried to deploy nwidart laravel module package using command " composer require nwidart/laravel-modules"

I got this error in terminal :

Trait "Illuminate\Console\Prohibitable" not found

at vendor\nwidart\laravel-modules\src\Commands\BaseCommand.php:17 13▕ use Symfony\Component\Console\Output\OutputInterface; 14▕ 15▕ use function Laravel\Prompts\multiselect; 16▕ ➜ 17▕ abstract class BaseCommand extends Command implements PromptsForMissingInput 18▕ { 19▕ use ConfirmableTrait; 20▕ use Prohibitable; 21▕

Whoops\Exception\ErrorException

Trait "Illuminate\Console\Prohibitable" not found

at vendor\nwidart\laravel-modules\src\Commands\BaseCommand.php:17 13▕ use Symfony\Component\Console\Output\OutputInterface; 14▕ 15▕ use function Laravel\Prompts\multiselect; 16▕ ➜ 17▕ abstract class BaseCommand extends Command implements PromptsForMissingInput 18▕ { 19▕ use ConfirmableTrait; 20▕ use Prohibitable; 21▕

1 vendor\filp\whoops\src\Whoops\Run.php:510 Whoops\Run::handleError("Trait "Illuminate\Console\Prohibitable" not found", "F:\Projects\train\training-app\vendor\nwidart\laravel-modules\src\Commands\BaseCommand.php")

2 [internal]:0 Whoops\Run::handleShutdown()

PHP Fatal error: Trait "Illuminate\Console\Prohibitable" not found in F:\Projects\train\training-app\vendor\nwidart\laravel-modules\src\Commands\BaseCommand.php on line 17 Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

0 likes
5 replies
MoSalem's avatar

@puklipo hi , i using laravel 10 , and in composer.json i make change "nwidart/laravel-modules" to be version ^10.0 and it looks like that :

"require": { "php": "^8.1", "guzzlehttp/guzzle": "^7.2", "laravel/framework": "^10.10", "laravel/sanctum": "^3.3", "laravel/tinker": "^2.8", "nwidart/laravel-modules": "^10.0" },

but error message still exits

MoSalem's avatar

hello , can someone assist me please ?

MoSalem's avatar
MoSalem
OP
Best Answer
Level 1

It solved !

For those who face the same problem when working with an old version of laravel such as v.10

You have to specify which version of the laravel modules you want to install that is compatible with the Laravel version

An example of the case here

composer require nwidart/laravel-modules 10

that's all

1 like

Please or to participate in this conversation.