Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel: PHP artisan Command Stopped Working

Tags:

laravel

php artisan --version

[Symfony\Component\Debug\Exception\FatalThrowableError]       
Fatal error: Call to a member function getArgument() on null  

Log files...

[2018-02-01 19:26:51] local.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Fatal error: Call to a member function getArgument() on null in /Library/WebServer/vhosts/mysitename/vendor/laravel/framework/src/Illuminate/Console/Command.php:216
Stack trace:
#0 /Library/WebServer/vhosts/mysitename/app/Console/Commands/ReportMonthlyMembershipAircraftBreakdown.php(69): Illuminate\Console\Command->argument('email')
#1 [internal function]: App\Console\Commands\ReportMonthlyMembershipAircraftBreakdown->__construct()
#2 /Library/WebServer/vhosts/mysitename/vendor/laravel/framework/src/Illuminate/Container/Container.php(783): ReflectionClass->newInstanceArgs(Array)
#3 /Library/WebServer/vhosts/mysitename/vendor/laravel/framework/src/Illuminate/Container/Container.php(633): Illuminate\Container\Container->build('App\\Console\\Com...', Array)
#4 /Library/WebServer/vhosts/mysitename/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(697): Illuminate\Container\Container->make('App\\Console\\Com...', Array)
#5 /Library/WebServer/vhosts/mysitename/vendor/laravel/framework/src/Illuminate/Console/Application.php(115): Illuminate\Foundation\Application->make('App\\Console\\Com...')
#6 /Library/WebServer/vhosts/mysitename/vendor/laravel/framework/src/Illuminate/Console/Application.php(129): Illuminate\Console\Application->resolve('App\\Console\\Com...')
#7 /Library/WebServer/vhosts/mysitename/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(237): Illuminate\Console\Application->resolveCommands(Array)
#8 /Library/WebServer/vhosts/mysitename/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Illuminate\Foundation\Console\Kernel->getArtisan()
#9 /Library/WebServer/vhosts/mysitename/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 {main} 

I have deleted my entire vendor folder and tried to reinstate it, and it always gets to here and blows up with the same error.

Generating autoload files
> php artisan clear-compiled
[Symfony\Component\Debug\Exception\FatalThrowableError]       
Fatal error: Call to a member function getArgument() on null  

Here is my version pulled from the file, since I can't run an artisan --version to get it for you.

/**
 * The Laravel framework version.
 *
 * @var string
 */
const VERSION = '5.2.32';

Just looking for any help you can give me. This has happened on both my local copy and the site copy

like image 514
Jonathan Pitcher Avatar asked Oct 19 '25 13:10

Jonathan Pitcher


1 Answers

The problem came from having the command

$this->argument in the contructor and not in the handle method.

I just never expected that a console file would stop php artisan --version from stopping to work because of a command file that was not going to be run yet.

Thanks btl for getting me on the right direction.

like image 71
Jonathan Pitcher Avatar answered Oct 21 '25 08:10

Jonathan Pitcher



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!