<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ### 命令行創建修改刪除命令 ### 1、通過 make:command 創建命令 * 可接受一個 name 參數,用于指定生成的命令文件名及命令類名, * 可指定一個 --command 選項,可用于指定命令名、命令參數及命令選項 * \--command默認值文 `command:name` ``` php artisan make:command 文件名 --command=命令名稱 php artisan make:command TestConsole --command=laravel:test php artisan make:command TestConsole ``` ### 3、執行命名 ``` php artisan 命名名 php artisan command:name ``` ### 4、修改命令 Artisan 的 make:command 命令只是生成了一個命令的骨架文件,我們需要對其進行修改。 #### 40.1、修改命令名、命令參數、命令選項 * 修改 $signature 屬性,設置 hash 命令的命令名、命令參數、命令選項: ``` protected $signature = 'hash {text} {--U|uppercase}'; ``` * 修改命令描述 `$description` 屬性,設置命令的描述信息: ``` protected $description = 'Calculate the md5 hash of a text'; ``` * 添加命令邏輯代碼 命令邏輯代碼應放在 `handle()`方法中,命令在執行時會自動調用此方法。 ``` public function handle() { $text = $this->argument('text'); // 獲取 text 參數 $uppercase = $this->option('uppercase'); // 獲取 uppercase 選項 $md5text = $uppercase ? strtoupper(md5($text)) : md5($text); $this->info("md5('{$text}') = $md5text"); // 輸出 } ``` Artisan 自帶的命令的源文件位于 `vendor\laravel\framework\src\Illuminate\Foundation\Console` 目錄 中,我們可以學習參考。 #### 4.2、運行命令 ``` $ php artisan hash "hello world" md5('hello world') = 5eb63bbbe01eeed093cb22bb8f5acdc3 ``` 帶上 -U 選項: ``` $ php artisan hash "hello world" -U md5('hello world') = 5EB63BBBE01EEED093CB22BB8F5ACDC3 ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看