FEATURE #2047: use laravel's authorization

This commit is contained in:
Michal Kváček
2017-08-02 13:33:26 +02:00
parent 67fb3c6945
commit a4c020daa0
60 changed files with 1357 additions and 50 deletions
@@ -0,0 +1,52 @@
<?php
namespace App\Notifications;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class ResetPasswordNotification extends Notification
{
/**
* @var string
*/
private $token;
/**
* Create a new notification instance.
* @return void
*/
public function __construct($token)
{
$this->token = $token;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
*
* @return array
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
*
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
$url = route('password.reset', ['token' => $this->token, 'email' => $notifiable->email]);
return (new MailMessage())->subject(trans('notification.forgottenPassword.subject'))
->line(trans('notification.forgottenPassword.firstLine'))
->action(trans('notification.forgottenPassword.button'), $url)
->line(trans('notification.forgottenPassword.lastLine'));
}
}