What I'm doing here is, I am inviting the users to the platform. So, basically I'm calling for a public function from the invitation model, which generates an invitation link based on the token. I am unable to set the link inside the button component of the markdown mailable template. As I cant call the {{ $invitation->getLink() }}
inside the single quotes. Sorry for being a noob, please help me down here.
public function generateToken() {
$this->token = substr(md5(rand(0, 9) . $this->email . time()), 0, 32);
}
public function getLink() {
return urldecode(route('register') . '?token=' . $this->token);
}
- views/mails/invitation-email.blade.php
@component('mail::message')
# Introduction
The body of your message.
@component('mail::button', ['url' => '{{ $invitation->getLink() }}'])
Button Text
@endcomponent
Thanks,<br>
{{ config('app.name') }}
@endcomponent
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…