4
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

6
  • The exception is coming from your command: ReportMonthlyMembershipAircraftBreakdown Commented Feb 1, 2018 at 19:25
  • I did upload the wrong log file but if you look that is where the code starts, not where the error is generated at. Commented Feb 1, 2018 at 19:27
  • You have this in your command, correct? $this->input->getArgument('email'); If so, it should just be $this->argument('email'); Commented Feb 1, 2018 at 19:32
  • what about php artisan serve or any other command?? Commented Feb 1, 2018 at 19:38
  • No other command worked. I figured it out though, posted an answer below. User error, but it causes issues you wouldn't expect it to cause. Commented Feb 1, 2018 at 19:52

2 Answers 2

11

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.

Sign up to request clarification or add additional context in comments.

Comments

0

You have an error in your code somewhere most likely which is giving you this error. Do a global search on getArgument() and see where it can be coming from.

[internal function]: App\Console\Commands\ReportMonthlyMembershipAircraftBreakdown

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.