I created a command with Artisan
$ php artisan command:make NeighborhoodCommand
This created the file app/commands/NeighborhoodCommand.php
Snippet of the code. I modified the name
value and filled in the fire()
function
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class NeighborhoodCommand extends Command {
protected $name = 'neighborhood';
public function fire()
{
// my code
}
}
But then when I try to run the command with
$ php artisan neighborhood
I get this error:
[InvalidArgumentException]
Command "neighborhood" is not defined.