title: PHP Artisan Custom Command
body: <p>I need a custom command in my php artisan.</p>
  
  <p>I have created the command file via artisan shell. </p>
  
  <p>But when I execute it via php artisan it throws it as undefined.</p>
  
  <p>It is also confusing for me how to add arguments to my command.</p>
  
  <p>Here is my whole command file:</p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Console\Command;
  use Symfony\Component\Console\Input\InputOption;
  use Symfony\Component\Console\Input\InputArgument;
  
  class createLibrarySet extends Command
  {
  
  /**
   * The console command name.
   *
   * @var string
   */
  protected $name = 'createLibrarySet';
  
  /**
   * The console command description.
   *
   * @var string
   */
  protected $description = 'Creates a Library Set.';
  
  /**
   * Create a new command instance.
   *
   * @return void
   */
  public function __construct()
  {
      parent::__construct();
  }
  
  /**
   * Execute the console command.
   *
   * @return mixed
   */
  public function fire()
  {
      $dir = mkdir(app_path()."/".library."/".$this-&gt;library_name);
      $coreName = $this-&gt;library_name;
      $serivceProvider = $coreName."."."ServiceProvider.php";
      $library = $coreName."."."Library.php";
      $facade = $coreName."."."Facade.php";
      $interface = $coreName."."."Interface.php";
      fopen($dir."/".$library, "w");
      fopen($dir."/".$facade, "w");
      fopen($dir."/".$serivceProvider, "w");
      fopen($dir."/".$interface, "w");
  }
  
  /**
   * Get the console command arguments.
   *
   * @return array
   */
  protected function getArguments()
  {
      return array(
          array('example', InputArgument::REQUIRED, 'An example argument.'),
      );
  }
  
  /**
   * Get the console command options.
   *
   * @return array
   */
  protected function getOptions()
  {
      return array(
          array('example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null),
      );
  }
  
  }
  </code></pre>