2017-02-14 13 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()を呼び出しても問題はありません。しかし、アプリURLを設定するために.envファイルを更新しましたか?

編集します.env

APP_URL=http://myshop.dev/ 

と、クリアキャッシュ

php artisan config:cache 
関連する問題