Laravel Argument 1 passed to App\Models\Recipients\AlertRecipient::__construct() must be an instance of App\Models\Recipients\string, string given,


今天測試snipet的計划任務,庫存低於警告值的時候,時候會會自動發送郵件到郵箱

class SendInventoryAlerts extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'snipeit:inventory-alerts';

 可以看到 當前命令的名稱為

  snipeit:inventory-alerts

我使用windows10調試的,開始:
1.打開cmd,cd.... 進入項目目錄
2.輸入 snipeit:inventory-alerts ,但是這時候出現了錯誤提示 :

 

最后發現是由於php版本的緣故,我現在使用的PHP版本是5.6.27

3.然后,我去修改環境變量,並且更新了當前的php版本為php7
然后重新打開cmd,輸入上述命令,出現的效果如下圖所示,大概隔了1秒做舊,立馬就收到郵件了,郵件成功發送

 




免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM