2017-02-14 49 views
1

我的代碼是這樣的:如何在郵件通知系統上使用基本URL? (Laravel 5.3)

public function toMail($notifiable) 
{ 
    return (new MailMessage) 
       ->subject('Test') 
       ->greeting('Hello '.$notifiable->store->name.'!') 
       ->line('Test 1') 
       ->line('Test 2') 
       ->action('Check Order',url('member/store/sale')) 
       ->line('Thanks'); 
} 

當我點擊的動作,它會調用http://localhost/member/store/sale

這是錯誤

應該調用它http://myshop.dev/member/store/sale

哪有我解決了它?

回答

3

調用url()應該很好地工作。但是,您是否更新.env文件以設置應用程序url?

編輯您的.ENV

APP_URL=http://myshop.dev/ 

,然後清除緩存

php artisan config:cache