2016-05-27 7 views
0

を動作していないが、それはLaravelコンソールコマンドの設定にlaravel 5.2上の例コンソールコマンドを試し

を働いていない私はphp artisan make:console CoolCommand

を走った私は、コマンド職人PHPを打つときはここに私のファイル

<?php 

namespace App\Console\Commands; 

use Illuminate\Console\Command; 

class CoolCommand extends Command 
{ 
    /** 
    * The name and signature of the console command. 
    * 
    * @var string 
    */ 
    protected $signature = 'be:cool'; 

    /** 
    * The console command description. 
    * 
    * @var string 
    */ 
    protected $description = 'Allows you to be cool'; 

    /** 
    * Create a new command instance. 
    * 
    * @return void 
    */ 
    public function __construct() 
    { 
     parent::__construct(); 
    } 

    /** 
    * Execute the console command. 
    * 
    * @return mixed 
    */ 
    public function handle() 
    { 
     echo "Yes you are very cool!"; 
    } 
} 

です指定された署名の下に掲載されていません

私は何が欠けていますか? ありがとう

+0

'kernel.php'の配列に追加しましたか? https://laravel.com/docs/5.2/artisan#registering-commands – iainn

答えて

1

php artisanと入力したときに表示されない場合は、hereのようにコマンドを登録するのを忘れてしまいました。 app/Console/Kernel.phpを開き、コマンドを入力します。

protected $commands = [ 
    Commands\CoolCommand::class 
]; 
+0

ouchを参照してください...うーん、私はドキュメントでこの点を見落としています、ありがとう – xhallix

関連する問題