如何在邮件通知系统上使用基本URL? (Laravel 5.3)

时间:2017-02-14 03:56:16

标签: php laravel email notifications 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

我该如何解决?

1 个答案:

答案 0 :(得分:3)

调用url()应该可以完美运行。但您是否更新了.env文件以设置应用程序URL?

编辑你的.env

APP_URL=http://myshop.dev/

然后清除缓存

php artisan config:cache