My code is like this :
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');
}
When I click the action, it will call http://localhost/member/store/sale
It's wrong
Should, it call http://myshop.dev/member/store/sale
How can I solve it?
Calling url()
should work perfectly. But did you update the .env file for setting app url?
Edit your .env
APP_URL=http://myshop.dev/
and then clear cache
php artisan config:cache