{"id":3402,"date":"2019-04-10T04:50:59","date_gmt":"2019-04-09T19:50:59","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=3402"},"modified":"2019-04-10T04:50:59","modified_gmt":"2019-04-09T19:50:59","slug":"%e3%80%90%e4%bf%9d%e5%ad%98%e7%89%88%e3%80%91laravel-%e7%8b%ac%e8%87%aaartisan%e3%82%b3%e3%83%9e%e3%83%b3%e3%83%89%e5%a4%a7%e5%85%a8%e9%9b%86%ef%bc%81","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=3402","title":{"rendered":"\u3010\u4fdd\u5b58\u7248\u3011Laravel \u72ec\u81eaArtisan\u30b3\u30de\u30f3\u30c9\u5927\u5168\u96c6\uff01"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u30d6\u30ed\u30b0\u3067\u306f\u79fb\u8ee2\u524d\u304b\u3089<code>Laravel<\/code>\u306b\u95a2\u3059\u308b\u8a18\u4e8b\u3092\u304a\u5c4a\u3051\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u3059\u3067\u306b\u8272\u3005\u306a\u6a5f\u80fd\u3092\u7d39\u4ecb\u3057\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u3068\u306f\u3044\u3048\u3001Laravel\u306f\u30db\u30f3\u30c8\u306b\u305f\u304f\u3055\u3093\u306e\u6a5f\u80fd\u3092\u5099\u3048\u3066\u3044\u308b\u306e\u3067\u307e\u3060\u307e\u3060\u53d6\u308a\u6271\u3063\u3066\u3044\u306a\u3044\u8a71\u984c\u304c\u6b8b\u3063\u3066\u3044\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u4eca\u56de\u306f\u3001\u305d\u306e\u4e2d\u3067\u3082\u79c1\u304c\u597d\u304d\u306a\u6a5f\u80fd<strong>\u300c\u72ec\u81eaArtisan\u30b3\u30de\u30f3\u30c9\u300d\u306e\u4f5c\u308a\u65b9\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/strong><\/p>\n<p>\u3061\u306a\u307f\u306b\u3001<code>Artisan\u30b3\u30de\u30f3\u30c9<\/code>\u3068\u3044\u3046\u306e\u306f\u3001Laravel\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u5099\u3048\u3066\u3044\u308b\u6a5f\u80fd\u3067\u3001\u4f8b\u3048\u3070\u300c\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u300d\u3060\u3063\u305f\u308a\u300c\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u81ea\u52d5\u4f5c\u6210\u300d\u306f\u7686\u3055\u3093\u3082\u3088\u304f\u4f7f\u3046\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001<code>Artisan\u30b3\u30de\u30f3\u30c9<\/code>\u3068\u3044\u3046\u3060\u3051\u3042\u3063\u3066\u3001\u5b9f\u884c\u306f\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\uff08\u30bf\u30fc\u30df\u30ca\u30eb\uff09\u3067\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u306d\u3002<br \/>\n\u2193\u2193\u2193<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3403\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/artisan_command.png\" alt=\"\" width=\"198\" height=\"21\" \/><\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u7279\u306b\u72ec\u81eaArtisan\u30b3\u30de\u30f3\u30c9\u306f\u3001<code>cron<\/code>\u3067\u30bf\u30a4\u30de\u30fc\u4e88\u7d04\u3092\u5b9f\u884c\u3055\u305b\u308b\u5834\u5408\u306b\u4fbf\u5229\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002\uff08\u4f8b\u3048\u3070\u3001\u30a2\u30af\u30bb\u30b9\u56de\u6570\u306e\u96c6\u8a08\u306a\u3069\u3042\u308b\u4e00\u5b9a\u671f\u9593\u3067\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3057\u305f\u3044\u5834\u5408\u306a\u3069\u3067\u3059\u306d\uff09<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u4eca\u56de\u306f\u3001\u72ec\u81ea\u30b3\u30de\u30f3\u30c9\u3092\u4f5c\u308b\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3405 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18.png\" alt=\"\" width=\"310\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18.png 310w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18-291x300.png 291w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/><\/p>\n<p>\u5b9f\u884c\u74b0\u5883\uff1a Laravel 5.8<\/p>\n<h1>\u72ec\u81ea\u306eArtisan\u30b3\u30de\u30f3\u30c9\u3092\u3064\u304f\u308b\u57fa\u672c<\/h1>\n<h2>\u30b3\u30de\u30f3\u30c9\u3067\u5b9f\u884c\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b<\/h2>\n<p>\u72ec\u81ea\u306eArtisan\u30b3\u30de\u30f3\u30c9\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u3001\u3069\u3046\u3059\u308b\u304b\u3068\u3044\u3046\u3068\u3001<strong>Artisan\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3044\u307e\u3059\uff08\u7b11\uff09<\/strong><\/p>\n<p>\u3067\u306f\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u3067<code>Laravel<\/code>\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u30d5\u30a9\u30eb\u30c0\u307e\u3067\u79fb\u52d5\u3057\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:command TestCommand<\/strong><\/pre>\n<p>\u3053\u308c\u3067<code>app\/Console\/TestCommand.php<\/code>\u3068\u3044\u3046\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002\uff08\u305f\u3060\u3057\u3001\u307e\u3060\u5b9f\u969b\u306b\u306f\u72ec\u81ea\u30b3\u30de\u30f3\u30c9\u5b9f\u884c\u306f\u3067\u304d\u307e\u305b\u3093\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3407\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-09-23-28-09.png\" alt=\"\" width=\"314\" height=\"113\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-09-23-28-09.png 314w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-09-23-28-09-300x108.png 300w\" sizes=\"auto, (max-width: 314px) 100vw, 314px\" \/><\/p>\n<p>\u3067\u306f\u3001\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u3063\u3066\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u300cHello!^^\u300d\u3068\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>php artisan hello<\/strong><\/pre>\n<p><code>TestCommand.php<\/code>\u306e\u5909\u66f4\u5f8c\u306e\u30b3\u30fc\u30c9\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>&lt;?php\r\n\r\n\/\/ \u7701\u7565\r\n\r\nclass TestCommand extends Command\r\n{\r\n    <strong>protected $signature = 'hello';<\/strong>\r\n    <strong>protected $description = 'Hello \u3068\u8868\u793a\u3059\u308b';\r\n<\/strong>\r\n    \/\/ \u7701\u7565\r\n    public function handle()\r\n    {\r\n        <strong>echo \"Hello!^^\";<\/strong>\r\n    }<\/pre>\n<p>\u307e\u305a<code>$signature<\/code>\u306e\u90e8\u5206\u3002\u3053\u308c\u306f\u30b3\u30de\u30f3\u30c9\u306e<code>php artisan ..<\/code>\u306b\u7d9a\u304f\u90e8\u5206\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u4eca\u56de\u306f\u300chello\u300d\u3067\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001<code>$description<\/code>\u306f\u305d\u306e\u30b3\u30de\u30f3\u30c9\u306e\u8aac\u660e\u6587\u3067\u3001<code>php artisan hello --help<\/code>\u3092\u5b9f\u884c\u3057\u305f\u3068\u304d\u306b\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\uff08\u3042\u307e\u308a\u3053\u3046\u3044\u3046\u5834\u5408\u306f\u65e5\u672c\u8a9e\u306e\u5168\u89d2\u6587\u5b57\u306f\u4f7f\u3046\u3079\u304d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u308f\u304b\u308a\u3084\u3059\u304f\u8aac\u660e\u3059\u308b\u305f\u3081\u306b\u3042\u3048\u3066\u4f7f\u3044\u307e\u3057\u305f\u3002\u306a\u304a\u3001\u79c1\u306e\u74b0\u5883\u3067\u306f\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3082\u3046\u307e\u304f\u8868\u793a\u3067\u304d\u307e\u3057\u305f\uff09<\/p>\n<p>\u305d\u3057\u3066\u6700\u5f8c\u306b<code>handle()<\/code>\u5185\u306b\u300cHello!^^\u300d\u3092\u8868\u793a\u3059\u308b\u90e8\u5206\u3092\u4f5c\u3063\u3066\u3044\u307e\u3059<\/p>\n<h2>\u4f5c\u6210\u3057\u305f\u30b3\u30de\u30f3\u30c9\u30d5\u30a1\u30a4\u30eb\u3092Laravel\u306b\u767b\u9332\u3059\u308b<\/h2>\n<p>\u3055\u304d\u307b\u3069\u306e\u9805\u76ee\u3067\u300c\u307e\u3060\u5b9f\u969b\u306b\u306f\u30b3\u30de\u30f3\u30c9\u5b9f\u884c\u306f\u3067\u304d\u307e\u305b\u3093\u300d\u3068\u66f8\u3044\u305f\u306e\u306f\u307e\u3060Laravel\u306b\u30b3\u30de\u30f3\u30c9\u3068\u3057\u3066\u767b\u9332\u3055\u308c\u3066\u3044\u306a\u3044\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001\u767b\u9332\u306e\u65b9\u6cd5\u306f\u7c21\u5358\u3067<code>app\/Console\/Kernel.php<\/code>\u5185\u306b\u3042\u308b<code>$commands<\/code>\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30af\u30e9\u30b9\u3092\u767b\u9332\u3059\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<pre><strong>use App\\Console\\Commands\\TestCommand;\r\n<\/strong>\r\nclass Kernel extends ConsoleKernel\r\n{\r\n    protected $commands = [\r\n        <strong>TestCommand::class<\/strong>\r\n    ];<\/pre>\n<h2>\u5b9f\u969b\u306bArtisan\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u307f\u308b<\/h2>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u2193\u2193\u2193<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3408\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-09-23-40-12.png\" alt=\"\" width=\"162\" height=\"38\" \/><\/p>\n<p>\u306f\u3044\uff01<br \/>\n\u3046\u307e\u304f\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u308c\u3067\u72ec\u81eaArtisan\u30b3\u30de\u30f3\u30c9\u3092\u4f5c\u308b\u65b9\u6cd5\u306f\u7d42\u4e86\u3067\u3059\u3002<\/p>\n<h2>\u3082\u3063\u3068\u30b7\u30f3\u30d7\u30eb\u306b\u30b3\u30de\u30f3\u30c9\u3092\u4f5c\u308a\u305f\u3044<\/h2>\n<p>\u3053\u3053\u307e\u3067\u3067\u7d39\u4ecb\u3057\u305f\u65b9\u6cd5\u306f\u72ec\u81eaArtisan\u30b3\u30de\u30f3\u30c9\u3092\u4f5c\u308b\u30ce\u30fc\u30de\u30eb\u306a\u65b9\u6cd5\u306b\u306a\u308a\u307e\u3059\u3002\u305f\u3060\u3001\u307b\u3057\u3044\u6a5f\u80fd\u306b\u3088\u3063\u3066\u306f\u300c\u305d\u3053\u307e\u3067\u8907\u96d1\u3058\u3083\u306a\u304f\u3066\u3044\u3044\u3093\u3060\u3051\u3069\u306a\u30fc\u300d\u306a\u3093\u3066\u5834\u5408\u3082\u3042\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u306fLaravel\u306b\u306f\u305d\u3093\u306a\u300c\u3061\u3087\u3063\u3068\u3057\u305f\u30b3\u30de\u30f3\u30c9\u300d\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u3082\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u30b5\u30f3\u30d7\u30eb\u3068\u3057\u3066\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u300cAloha!\u300d\u3068\u8868\u793a\u3059\u308b\u3060\u3051\u306e\u30b7\u30f3\u30d7\u30eb\u306a\u72ec\u81ea\u30b3\u30de\u30f3\u30c9\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001<code>routes\/console.php<\/code>\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30de\u30f3\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>Artisan::command('aloha', function () {<\/strong>\r\n\r\n<strong>    $this-&gt;info('Aloha!');<\/strong>\r\n\r\n<strong>})-&gt;describe('Aloha \u3092\u8868\u793a\u3059\u308b');<\/strong><\/pre>\n<p>\u3084\u3063\u3066\u3044\u308b\u3053\u3068\u306f\u3001<\/p>\n<ul>\n<li><code>function()<\/code>\u5185\u3067\u5b9f\u884c\u3057\u305f\u3044\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3000\u30fb\u30fb\u30fb\u3000\u3064\u307e\u308a\u524d\u9805\u76ee\u306e<code>handle()<\/code>\u3067\u3059\u306d\u3002<\/li>\n<li><code>describe()<\/code>\u3067\u8aac\u660e\u6587\u3092\u6307\u5b9a\u3059\u308b\u3000\u30fb\u30fb\u30fb\u3000\u3053\u308c\u306f\u306a\u304f\u3066\u3082\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002\u307e\u305f\u3001\u308f\u304b\u308a\u3084\u3059\u304f\u8aac\u660e\u3059\u308b\u305f\u3081\u306b\u65e5\u672c\u8a9e\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u5b9f\u969b\u306b\u306f\u534a\u89d2\u82f1\u6570\u5b57\u306e\u65b9\u304c\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/li>\n<\/ul>\n<p>\u306e\uff12\u3064\u3067\u3059\u3002<\/p>\n<p>\u3082\u3061\u308d\u3093\u4ee5\u4e0b\u306e\u3088\u3046\u306b<a href=\"#args_n_options\">\u5909\u6570\u3084\u30aa\u30d7\u30b7\u30e7\u30f3<\/a>\u3082\u4f7f\u3048\u307e\u3059\u3002<\/p>\n<pre>Artisan::command(<strong>'aloha {name}'<\/strong>, function () {\r\n\r\n    $this-&gt;info('Aloha!');\r\n\r\n});<\/pre>\n<h1 id=\"args_n_options\">\u72ec\u81eaArtisan\u30b3\u30de\u30f3\u30c9\u306b\u5909\u6570\u3084\u30aa\u30d7\u30b7\u30e7\u30f3\u5024\u3092\u3064\u3051\u308b<\/h1>\n<p>\u4f8b\u3048\u3070\u3001\u72ec\u81eaArtisan\u30b3\u30de\u30f3\u30c9\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u53ef\u5909\u306e\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3057\u305f\u3044\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre>php artisan hello <strong>John<\/strong> <strong>--from=Mike<\/strong><\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3067\u3001\u72b6\u6cc1\u306b\u5fdc\u3058\u305f\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u3067\u306f\u3072\u3068\u3064\u305a\u3064\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>\u5909\u6570\u3092\u3064\u3051\u308b<\/h2>\n<h3>\u57fa\u672c\u7684\u306a\u5909\u6570<\/h3>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b<code>Hello<\/code>\u306b\u7d9a\u304f\u540d\u524d\u3092\uff08\u5fc5\u9808\uff09\u5165\u529b\u3068\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>php artisan hello <strong>xxx<\/strong><\/pre>\n<p><code>TestCommand.php<\/code>\u306e\u4f8b\u3067\u8a00\u3046\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u6570\u3092\u6ce2\u62ec\u5f27\u3067\u56f2\u307f\u307e\u3059\u3002<\/p>\n<pre>protected $signature = 'hello <strong>{name}<\/strong>';<\/pre>\n<p>\u305d\u3057\u3066\u3001\u3053\u306e<code>{name}<\/code>\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f<code>argument()<\/code>\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>$name = $this-&gt;argument('name');<\/strong><\/pre>\n<p>\u305f\u3060\u3057\u3001\u3053\u306e\u72b6\u614b\u3067\u306f\u5148\u307b\u3069\u3082\u66f8\u3044\u305f\u3068\u304a\u308a\u5909\u6570\u306f\u5fc5\u9808\u5165\u529b\u3067\u3042\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3064\u307e\u308a\u3001\u3053\u306e\u72b6\u614b\u3067\u5909\u6570\u3092\u7701\u7565\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306e\u30a8\u30e9\u30fc\u3067\u3059\u3002\uff08\u8d85\u610f\u8a33\uff1a\u300cname\u3063\u3066\u3044\u3046\u5909\u6570\u304c\u306d\u30fc\u3088\uff1f\uff1f\u300d\uff09<br \/>\n\u2193\u2193\u2193<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3412\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-00-05-52.png\" alt=\"\" width=\"383\" height=\"61\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-00-05-52.png 383w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-00-05-52-300x48.png 300w\" sizes=\"auto, (max-width: 383px) 100vw, 383px\" \/><\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u3082\u3057\u7701\u7565\u3082OK\u306b\u3057\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b<code>?<\/code>\u30de\u30fc\u30af\u3092\u3064\u3051\u307e\u3059\u3002<\/p>\n<pre>protected $signature = 'hello <strong>{name?}<\/strong>';<\/pre>\n<p>\u3055\u3089\u306b\u3001\u3082\u3057\u7701\u7565\u3055\u308c\u305f\u5834\u5408\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b<code>=<\/code>\u3092\u3064\u3051\u308b\u3068\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<pre>protected $signature = 'hello <strong>{name=Michael}<\/strong>';<\/pre>\n<p>\u306a\u304a\u3001\u3082\u3057\u8907\u6570\u306e\u5909\u6570\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3044\u304f\u3064\u3067\u3082\u8ffd\u52a0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>protected $signature = 'hello <strong>{name=Michael} {smile=^o^}<\/strong>';<\/pre>\n<h3>\u5909\u6570\u306b\u914d\u5217\u3092\u6307\u5b9a\u3059\u308b<\/h3>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8907\u6570\u306e\u540d\u524d\u3092\u5909\u6570\u3068\u3057\u3066\u6307\u5b9a\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre>php artisan hello <strong>John Bob Peter<\/strong><\/pre>\n<p>\u5909\u6570\u306b\u914d\u5217\u3092\u6307\u5b9a\u3059\u308b\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b*\u3092\u6700\u5f8c\u306b\u3064\u3051\u307e\u3059\u3002<\/p>\n<pre>protected $signature = 'hello <strong>{from*}<\/strong>';<\/pre>\n<p>\u53d6\u5f97\u65b9\u6cd5\u306f\u3001\u57fa\u672c\u7684\u306a\u5909\u6570\u3068\u540c\u3058\u304f<code>$this-&gt;argument('***')<\/code>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<h2>\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u308b<\/h2>\n<h3>true \/ false \u3092\u53d6\u5f97\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3<\/h3>\n<p>\u4f8b\u3048\u3070\u3001\u8868\u793a\u3092\u3059\u308b\uff0f\u3057\u306a\u3044\u3092\u6c7a\u3081\u308b<code>--display<\/code>\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u305f\u3044\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre>protected $signature = 'hello <strong>{--display}<\/strong>';<\/pre>\n<p>\u3053\u306e\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30aa\u30d7\u30b7\u30e7\u30f3\u5024\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u3067\u30c6\u30ad\u30b9\u30c8\u306e\u8868\u793a\uff0f\u975e\u8868\u793a\u3092\u5207\u308a\u66ff\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>\/\/ php artisan hello --display \u3092\u5b9f\u884c\r\n\r\npublic function handle()\r\n{\r\n    <strong>$display = $this-&gt;option('display');<\/strong> \/\/ \u3053\u306e\u5834\u5408\u306f\u3001true \u306b\u306a\u308b\r\n\r\n    if($display) {\r\n\r\n        echo \"Hello!\\n\"; \/\/ \u8868\u793a\u3055\u308c\u308b\r\n\r\n    }\r\n}<\/pre>\n<p>\u5024\u3092\u53d6\u5f97\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u300cHello, Bob!\u300d\u3068\u5165\u529b\u3057\u305f\u540d\u524d\u3092\u8868\u793a\u3057\u305f\u3044\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre>php artisan hello <strong>--from=Bob<\/strong><\/pre>\n<p>\u3053\u306e\u5834\u5408\u306f\u5148\u307b\u3069\u306e<code>true \/ false<\/code>\u306e\u5834\u5408\u3068\u9055\u3044\u3001<code>=<\/code>\u3092\u3064\u3051\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u306a\u304a\u3001\u3082\u3061\u308d\u3093\u30a4\u30b3\u30fc\u30eb\u306e\u5f8c\u306b\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>protected $signature = 'hello <strong>{--from=}<\/strong>';\r\n\r\n\/\/ \u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u30fb\u30fb\u30fb\r\n\r\nprotected $signature = 'hello <strong>{--from=Bob}<\/strong>';<\/pre>\n<p>\u3053\u308c\u3067\u3001<code>option()<\/code>\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u5024\u3092\u53d6\u308a\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>$from = $this-&gt;<strong>option('from')<\/strong>; \/\/ Bob \u3084 Peter \u304c\u5165\u3063\u3066\u304f\u308b<\/pre>\n<p>\u3061\u306a\u307f\u306b\u30b3\u30de\u30f3\u30c9\u306b\u8a73\u3057\u3044\u65b9\u306a\u3089\u3054\u5b58\u77e5\u3067\u3057\u3087\u3046\u304c\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u6307\u5b9a\u65b9\u6cd5\u306b\u306f\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u30fb\u30d0\u30fc\u30b8\u30e7\u30f3\u3082\u3042\u308a\u307e\u3059\u3002Laravel\u3067\u306f\u3053\u306e\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u7248\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u6307\u5b9a\u306b\u3082\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u6b21\u306e\u3088\u3046\u306b<code>-F<\/code>\u3092\u4f7f\u3063\u3066<code>from<\/code>\u306e\u5024\u3092\u5165\u529b\u3057\u305f\u3044\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre>php artisan hello <strong>-F Bill<\/strong><\/pre>\n<p>\u3053\u306e\u5834\u5408\u3001\u30b3\u30de\u30f3\u30c9\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>protected $signature = 'hello <strong>{--F|from=Bill}<\/strong>';<\/pre>\n<p>\u3082\u3061\u308d\u3093\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306e\u6307\u5b9a\u65b9\u6cd5\u306f\u540c\u3058\u3067\u3059\u3057\u3001<code>--from=xxx<\/code>\u3082\u4f7f\u3048\u307e\u3059\u3002<\/p>\n<h3>\u914d\u5217\u3092\u53d6\u5f97\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3<\/h3>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b<code>--from<\/code>\u3067\u8907\u6570\u306e\u540d\u524d\u3092\u6307\u5b9a\u3057\u305f\u3044\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre>php artisan hello <strong>--from=John --from=Bob --from=Peter<\/strong><\/pre>\n<p>\u3053\u306e\u5834\u5408\u306f\u3001\u5909\u6570\u3068\u540c\u3058\u3088\u3046\u306b<code>*<\/code>\u3092\u3064\u3051\u307e\u3059\u3002<\/p>\n<pre>protected $signature = 'hello <strong>{--from=*}<\/strong>';<\/pre>\n<p>\u306a\u304a\u3001\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u306e\u306f\u901a\u5e38\u3068\u540c\u3058\u304f<code>$this-&gt;option('***')<\/code>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<h2>\u4e00\u6c17\u306b\u5909\u6570\u3084\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u5909\u6570\u3084\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u305f\u304f\u3055\u3093\u6307\u5b9a\u3059\u308b\u3068\u3044\u3061\u3044\u3061<code>$this-&gt;argument('***')<\/code>\u3084<code>$this-&gt;option('***')<\/code>\u306a\u3069\u3068\u66f8\u304f\u306e\u306f\u3081\u3093\u3069\u3046\u306b\u306a\u3063\u305f\u308a\u3082\u3059\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u305d\u3093\u306a\u5834\u5408\u306f\u4ee5\u4e0b\uff12\u3064\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u3068\u4e00\u6c17\u306b\u914d\u5217\u3067\u5024\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>\/\/ \u5909\u6570\u306e\u5834\u5408\r\n<strong>$arguments = $this-&gt;arguments();<\/strong>\r\n\r\n\/\/ \u30aa\u30d7\u30b7\u30e7\u30f3\r\n<strong>$options = $this-&gt;options();<\/strong><\/pre>\n<p>\u203b \u3082\u3057\u5909\u6570\u3084\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306f<code>null<\/code>\u304c\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>\u5909\u6570\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u8aac\u660e\u6587\u3092\u3064\u3051\u308b<\/h2>\n<p>\u5909\u6570\u3084\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u4fbf\u5229\u3067\u3059\u304c\u3001\u5168\u3066\u306e\u610f\u5473\u3092\u899a\u3048\u3066\u304a\u304f\u306e\u306f\u7c21\u5358\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001\u305d\u3093\u306a\u5834\u5408\u306b\u5099\u3048\u3066\u5909\u6570\u3084\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u8aac\u660e\u6587\u3092\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3063\u3066\u5b9f\u969b\u306e\u65b9\u6cd5\u3092\u307f\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>protected $signature = 'hello <strong>{--name=Bob : \u3042\u3044\u3055\u3064\u3059\u308b\u4eba\u306e\u540d\u524d}<\/strong>';<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u8aac\u660e\u6587\u3092\u3064\u3051\u308b\u306b\u306f<code>:<\/code>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u203b \u6ce8\u610f\uff1a \u308f\u304b\u308a\u3084\u3059\u304f\u8aac\u660e\u3059\u308b\u305f\u3081\u306b\u4f7f\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u65e5\u672c\u8a9e\u306f\u4f7f\u308f\u306a\u3044\u65b9\u304c\u7121\u96e3\u3067\u3059\u3002<\/p>\n<p><code>php artisan hello --help<\/code>\u3092\u5b9f\u884c\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3420\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-01-10-45.png\" alt=\"\" width=\"564\" height=\"43\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-01-10-45.png 564w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-01-10-45-300x23.png 300w\" sizes=\"auto, (max-width: 564px) 100vw, 564px\" \/><\/p>\n<p>\u5909\u6570\u306e\u5834\u5408\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3419\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-01-13-16.png\" alt=\"\" width=\"562\" height=\"49\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-01-13-16.png 562w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-01-13-16-300x26.png 300w\" sizes=\"auto, (max-width: 562px) 100vw, 562px\" \/><\/p>\n<h1>\u30a2\u30a6\u30c8\u30d7\u30c3\u30c8\u3059\u308b<\/h1>\n<h2>\u30c6\u30ad\u30b9\u30c8\u3092\u30a2\u30a6\u30c8\u30d7\u30c3\u30c8\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u51e6\u7406\u304c\u7d42\u4e86\u3057\u305f\u5834\u5408\u306a\u3069\u306b<strong>\u300cDone!\u300d<\/strong>\u306a\u3069\u3068\u3057\u3066\u30c6\u30ad\u30b9\u30c8\u3092\u8868\u793a\u3057\u305f\u3044\u5834\u5408\u306b\u306f\u4ee5\u4e0b\uff15\u3064\u306e\u30a2\u30a6\u30c8\u30d7\u30c3\u30c8\u65b9\u6cd5\u3092\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>line()\u3000\u30fb\u30fb\u30fb\u3000\u88c5\u98fe\u306a\u3057\u306e\u30c6\u30ad\u30b9\u30c8<\/li>\n<li>info()\u3000\u30fb\u30fb\u30fb\u3000\u7dd1\u30c6\u30ad\u30b9\u30c8<\/li>\n<li>question()\u3000\u30fb\u30fb\u30fb\u3000\u9752\u306e\u30c6\u30ad\u30b9\u30c8<\/li>\n<li>comment()\u3000\u30fb\u30fb\u30fb\u3000\u9ec4\u8272\u306e\u30c6\u30ad\u30b9\u30c8<\/li>\n<li>error()\u3000\u30fb\u30fb\u30fb\u3000\u8d64\u306e\u30c6\u30ad\u30b9\u30c8<\/li>\n<\/ul>\n<p>\u203b \u8272\u306fUbuntu 18.04\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u5b9f\u884c\u3057\u305f\u3082\u306e\u3067\u3059\u304c\u3001\u901a\u5e38\u306f\u540c\u3058\u3088\u3046\u306a\u8272\u306b\u306a\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306e\u4f7f\u3044\u65b9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>public function handle()\r\n{\r\n    <strong>$this-&gt;line('line');<\/strong>\r\n<strong>    $this-&gt;info('info');<\/strong>\r\n<strong>    $this-&gt;question('question');<\/strong>\r\n<strong>    $this-&gt;comment('comment');<\/strong>\r\n<strong>    $this-&gt;error('error');<\/strong>\r\n}<\/pre>\n<p>\u5b9f\u884c\u3057\u305f\u3082\u306e<br \/>\n\u2193\u2193\u2193<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3426\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-02-43-59.png\" alt=\"\" width=\"93\" height=\"96\" \/><\/p>\n<p>\u3061\u306a\u307f\u306b\u81ea\u52d5\u7684\u306b\u6539\u884c\u3057\u3066\u304f\u308c\u308b\u306e\u3067<code>\\n<\/code>\u306a\u3069\u306e\u6539\u884c\u30b3\u30fc\u30c9\u3092\u6700\u5f8c\u306b\u3064\u3051\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<h2>\u30c6\u30fc\u30d6\u30eb\u3067\u30a2\u30a6\u30c8\u30d7\u30c3\u30c8\u3059\u308b<\/h2>\n<p>\u305f\u304f\u3055\u3093\u306e\u30c7\u30fc\u30bf\u3092\u30a2\u30a6\u30c8\u30d7\u30c3\u30c8\u3057\u305f\u3044\u5834\u5408\u306f\u30c6\u30fc\u30d6\u30eb\u4e0a\u306b\u3057\u3066\u30a2\u30a6\u30c8\u30d7\u30c3\u30c8\u304c\u3067\u304d\u308b<code>table()<\/code>\u3092\u4f7f\u3046\u3068\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u4f7f\u3044\u65b9\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>$headers = ['Name', 'Age'];\r\n$students = [\r\n    ['\u9234\u6728', 26],\r\n    ['\u4f50\u85e4', 32],\r\n    ['\u7530\u4e2d', 21],\r\n];\r\n<strong>$this-&gt;table($headers, $students);<\/strong><\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3428\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-02-51-45.png\" alt=\"\" width=\"138\" height=\"126\" \/><\/p>\n<h2>\u30d7\u30ed\u30b0\u30ec\u30b9\u30d0\u30fc\u3092\u8868\u793a\u3059\u308b<\/h2>\n<p>\u30d7\u30ed\u30b0\u30ec\u30b9\u30d0\u30fc\u3068\u3044\u3046\u306e\u306f\u3001\u300c\u4eca\u3069\u306e\u304f\u3089\u3044\u51e6\u7406\u304c\u5b8c\u4e86\u3057\u3066\u3044\u308b\u304b\u304c\u5206\u304b\u308b\u8868\u793a\u300d\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001\u5916\u90e8\u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u5834\u5408\u306f\u6642\u9593\u304c\u304b\u304b\u308b\u5834\u5408\u304c\u591a\u3044\u3067\u3059\u304c\u3001\u3053\u3046\u3044\u3063\u305f\u5834\u5408\u306b\u30d7\u30ed\u30b0\u30ec\u30b9\u30d0\u30fc\u3092\u8868\u793a\u3057\u3066\u304a\u304f\u3068\u72b6\u6cc1\u3092\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u628a\u63e1\u3067\u304d\u308b\u306e\u3067\u3068\u3066\u3082\u4fbf\u5229\u3067\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306e\u30b3\u30fc\u30c9\u3067\u3059\u3002<br \/>\n\u5185\u5bb9\u3068\u3057\u3066\u306f\u3001<strong>10\u4ef6\u306e\u30c7\u30fc\u30bf\u3067\u6642\u9593\u304c\u304b\u304b\u308b\u51e6\u7406\u3092\u3059\u308b<\/strong>\u3068\u3044\u3046\u3082\u306e\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>$count = 10;<\/strong>\r\n<strong>$progress = $this-&gt;output-&gt;createProgressBar($count);<\/strong>\r\n<strong>$progress-&gt;start();<\/strong>\r\n\r\n<strong>for($i = 0 ; $i &lt; $count ; $i++) {<\/strong>\r\n\r\n<strong>    \/\/ \u3053\u3053\u3067\u6642\u9593\u304c\u304b\u304b\u308b\u51e6\u7406<\/strong>\r\n\r\n<strong>    $progress-&gt;advance(); \/\/ \u6b21\u306b\u9032\u3080<\/strong>\r\n<strong>    sleep(1); \/\/ \u30c6\u30b9\u30c8\u3067\u3064\u3051\u3066\u3044\u307e\u3059\u304c\u672c\u6765\u306f\u3044\u308a\u307e\u305b\u3093\u3002<\/strong>\r\n\r\n<strong>}<\/strong>\r\n\r\n<strong>$progress-&gt;finish();<\/strong><\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3430\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-03-06-12.png\" alt=\"\" width=\"390\" height=\"38\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-03-06-12.png 390w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-03-06-12-300x29.png 300w\" sizes=\"auto, (max-width: 390px) 100vw, 390px\" \/><\/p>\n<h1>\u5165\u529b\u3092\u3059\u308b<\/h1>\n<p>\u4f8b\u3048\u3070\u3001\u72ec\u81ea\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3001\u5bfe\u8a71\u5f62\u5f0f\u3067\u540d\u524d\u3084Email\u306a\u3069\u3092\u5165\u529b\u3055\u305b\u305f\u3044\u5834\u5408\u306b\u4f7f\u3046\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n<h2>\u901a\u5e38\u306e\u5165\u529b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u540d\u524d\u3092\u5165\u529b\u3057\u3066\u3082\u3089\u3044\u305f\u3044\u5834\u5408\u306f<code>ask()<\/code>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre>$name = <strong>$this-&gt;ask('\u304a\u540d\u524d\u306f\uff1f');<\/strong>\r\n$this-&gt;line($name .'\u3055\u3093\u3001\u3053\u3093\u306b\u3061\u306f\uff01');<\/pre>\n<p>\u5b9f\u969b\u306b\u5b9f\u884c\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3432\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-03-26-16.png\" alt=\"\" width=\"138\" height=\"44\" \/><\/p>\n<p>\u306a\u304a\u3001\u7b2c\uff12\u5f15\u6570\u3067\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u305d\u306e\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3433\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-03-28-07.png\" alt=\"\" width=\"183\" height=\"53\" \/><\/p>\n<h2>\u79d8\u5bc6\u306e\u5165\u529b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u306a\u3069\u5165\u529b\u3057\u305f\u3082\u306e\u3092\u8868\u793a\u3055\u305b\u305f\u304f\u306a\u3044\u5834\u5408\u306f<code>secret()<\/code>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre>$password = <strong>$this-&gt;secret('\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\uff1f');<\/strong>\r\n$this-&gt;line('\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u3001\u300c'. $password .'\u300d\u3067\u3059\u3002');<\/pre>\n<h2>Yes \/ No \u306e\u78ba\u8a8d<\/h2>\n<p>Yes \/ No \u306e\u78ba\u8a8d\u3092\u3057\u305f\u3044\u5834\u5408\u306f\u3001<code>confirm()<\/code>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre>if(<strong>$this-&gt;confirm('\u30dd\u30c6\u30c8\u3082\u4ed8\u3051\u307e\u3059\u304b\uff1f')<\/strong>) {\r\n\r\n    $this-&gt;line('\u30dd\u30c6\u30c8\u3064\u3051\u307e\u3059\uff01');\r\n\r\n}<\/pre>\n<p>\u5b9f\u969b\u306b\u5b9f\u884c\u3059\u308b\u3068\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3434\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-03-33-59.png\" alt=\"\" width=\"333\" height=\"54\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-03-33-59.png 333w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-03-33-59-300x49.png 300w\" sizes=\"auto, (max-width: 333px) 100vw, 333px\" \/><\/p>\n<p>\u306a\u304a\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u6307\u5b9a\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f<code>false<\/code>\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u7b2c\uff12\u5f15\u6570\u3067\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>$this-&gt;confirm('\u30dd\u30c6\u30c8\u3082\u4ed8\u3051\u307e\u3059\u304b\uff1f', true);<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3436\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-03-33-59_2-1.png\" alt=\"\" width=\"337\" height=\"54\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-03-33-59_2-1.png 337w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-03-33-59_2-1-300x48.png 300w\" sizes=\"auto, (max-width: 337px) 100vw, 337px\" \/><\/p>\n<h2>\u9078\u629e\u80a2\u306e\u4e2d\u304b\u3089\u9078\u3070\u305b\u308b<\/h2>\n<p>\u3044\u304f\u3064\u304b\u306e\u9078\u629e\u80a2\u306e\u4e2d\u304b\u3089\u9078\u3070\u305b\u308b\u5834\u5408\u306f\u3001<code>choice()<\/code>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre>$default_index = 0;\r\n$lunch = <strong>$this-&gt;choice('\u4eca\u65e5\u306e\u30e9\u30f3\u30c1\u306f\uff1f', ['\u30ab\u30d5\u30a7', '\u725b\u4e3c', 'Uber eats'], $default_index)<\/strong>;\r\n$this-&gt;line($lunch .'\u306b\u3057\u3088\u3046\uff01');<\/pre>\n<p>\u5b9f\u969b\u306b\u5b9f\u884c\u3059\u308b\u3068\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3437\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-03-41-14.png\" alt=\"\" width=\"264\" height=\"111\" \/><\/p>\n<p>\u3061\u306a\u307f\u306b\u3001<strong style=\"font-size: 1rem;\">choice()\u306f\u7528\u610f\u3055\u308c\u305f\u9078\u629e\u80a2\u306b\u306a\u3044\u3082\u306e\u3092\u9078\u3076\u3068\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3439\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-03-46-05.png\" alt=\"\" width=\"286\" height=\"52\" \/><\/p>\n<p>\u203b \u3082\u3057\u9078\u629e\u80a2\u4ee5\u5916\u306e\u3082\u306e\u3082\u5165\u529b\u3055\u305b\u305f\u3044\u5834\u5408\u306f\u3001<a href=\"#anticipate\">anticipate()<\/a>\u3092\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2 id=\"anticipate\">\u5019\u88dc\u304c\u7528\u610f\u3055\u308c\u305f\u5165\u529b<\/h2>\n<p>\u3042\u3089\u304b\u3058\u3081\u3044\u304f\u3064\u304b\u306e\u9078\u629e\u80a2\u3092\u7528\u610f\u3057\u3066\u304a\u304f\u3051\u308c\u3069\u3001\u81ea\u7531\u306a\u5165\u529b\u3082\u8a31\u53ef\u3057\u305f\u3044\u5834\u5408\u306f\u3001<code>anticipate()<\/code>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre>$dinner = <strong>$this-&gt;anticipate('\u4eca\u65e5\u306e\u30c7\u30a3\u30ca\u30fc\u306f\uff1f', ['\u548c\u98df', '\u6d0b\u98df', '\u4e2d\u83ef'])<\/strong>;\r\n$this-&gt;line($dinner .'\u306b\u3057\u3088\u3046\uff01');<\/pre>\n<p>\u5b9f\u969b\u306b\u5b9f\u884c\u3059\u308b\u3068\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3441\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-03-48-53.png\" alt=\"\" width=\"198\" height=\"53\" \/><\/p>\n<p>\u4e00\u898b\u3059\u308b\u3068\u901a\u5e38\u306e\u5165\u529b\u3068\u540c\u3058\u3088\u3046\u306b\u898b\u3048\u307e\u3059\u304c\u3001\u30ad\u30fc\u30dc\u30fc\u30c9\u306e\u4e0a\uff0f\u4e0b\u3067\u5019\u88dc\u3092\u9078\u629e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3440\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-03-48-53_2.png\" alt=\"\" width=\"198\" height=\"53\" \/><\/p>\n<p>\u3082\u3061\u308d\u3093\u81ea\u7531\u306b\u5165\u529b\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3442\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-03-48-53_3.png\" alt=\"\" width=\"198\" height=\"53\" \/><\/p>\n<p>\u306a\u304a\u3001\u7b2c\uff12\u5f15\u6570\u3067\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<br \/>\n\u5b9f\u969b\u306b\u5b9f\u884c\u3057\u305f\u3082\u306e\u306f\u3053\u3061\u3089\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3443\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/Screenshot-from-2019-04-10-03-53-28.png\" alt=\"\" width=\"265\" height=\"66\" \/><\/p>\n<h1>\u304a\u307e\u3051\uff1acron\u3067\u5b9f\u884c\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u30fb\u30fb\u30fb<\/h1>\n<p>\u72ec\u81ea\u306eArtisan\u30b3\u30de\u30f3\u30c9\u3092\u4f5c\u3063\u3066cron\u3067\u30bf\u30a4\u30de\u30fc\u5b9f\u884c\u3057\u3088\u3046\u3068\u3059\u308b\u5834\u5408\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u3082\u3046\u307e\u304f\u3044\u304b\u306a\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>30 12 * * * php artisan hello<\/strong><\/pre>\n<p>\u3053\u306e\u539f\u56e0\u306e\u3072\u3068\u3064\u3068\u3057\u3066\u3001\u30d1\u30b9\u304c\u3046\u307e\u304f\u6307\u5b9a\u3067\u304d\u3066\u3044\u306a\u3044\u3053\u3068\u304c\u6319\u3052\u3089\u308c\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u3082\u3057\u3046\u307e\u304f\u5b9f\u884c\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30d5\u30eb\u30d1\u30b9\u3067\u6307\u5b9a\u3092\u3057\u3066\u307f\u308b\u3068\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>30 12 * * * \/usr\/bin\/php \/var\/www\/html\/laravel58\/artisan hello<\/strong><\/pre>\n<p>\u3061\u306a\u307f\u306bPHP\u306e\u30d5\u30eb\u30d1\u30b9\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>which php<\/strong><\/pre>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u72ec\u81ea\u306eArtisan\u30b3\u30de\u30f3\u30c9\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u3092\u304a\u5c4a\u3051\u3057\u307e\u3057\u305f\u3002\u7c21\u5358\u306a\u30b5\u30a4\u30c8\u3060\u3051\u3067\u3057\u305f\u3089\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u308f\u305a\u3068\u3082\u3042\u308b\u7a0b\u5ea6\u306e\u6a5f\u80fd\u3092\u3064\u304f\u308b\u3053\u3068\u306f\u3067\u304d\u308b\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u4f8b\u3048\u3070\u5927\u304d\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u305f\u308a\u3001Python\u306a\u3069\u306e\u4ed6\u306e\u8a00\u8a9e\u3068\u9023\u643a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u5834\u5408\u306f\u30b3\u30de\u30f3\u30c9\u304c\u3069\u3046\u3057\u3066\u3082\u5fc5\u8981\u306b\u306a\u3063\u3066\u304d\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u3082\u3053\u306e\u30da\u30fc\u30b8\u3092\u4f7f\u3063\u3066\u697d\u306b\u72ec\u81ea\u30b3\u30de\u30f3\u30c9\u3092\u4f5c\u3063\u3066\u9023\u643a\u3055\u305b\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\uff01\uff08\u4e45\u3057\u3076\u308a\u306e\u9577\u6587\u8a18\u4e8b\u3067\u3061\u3087\u3063\u3068\u75b2\u308c\u307e\u3057\u305f ^^;\uff09<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-444 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/16.png\" alt=\"\" width=\"370\" height=\"310\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/16.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/16-300x251.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/>\u300c\u304a\u3084\u3059\u307f\u306a\u3055\u3044&#8230;\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u30d6\u30ed\u30b0\u3067\u306f\u79fb\u8ee2\u524d\u304b\u3089Laravel\u306b\u95a2\u3059\u308b\u8a18\u4e8b\u3092\u304a\u5c4a\u3051\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u3059\u3067\u306b\u8272\u3005\u306a\u6a5f\u80fd\u3092\u7d39\u4ecb\u3057\u3066\u304d\u307e\u3057\u305f\u3002 \u3068\u306f\u3044\u3048\u3001Laravel\u306f\u30db\u30f3\u30c8\u306b\u305f\u304f\u3055 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=3402\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u3010\u4fdd\u5b58\u7248\u3011Laravel \u72ec\u81eaArtisan\u30b3\u30de\u30f3\u30c9\u5927\u5168\u96c6\uff01&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":3453,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[50],"class_list":["post-3402","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-50"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/3402","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3402"}],"version-history":[{"count":24,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/3402\/revisions"}],"predecessor-version":[{"id":3451,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/3402\/revisions\/3451"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/3453"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3402"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3402"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}