я создал локализованную копию ResetPassword.php
, переопределил метод sendPasswordResetNotification()
в app\user
. Общем все сделал по правилу( я так думаю))). Все норм, письмо в mail отправляет но только одно проблема есть. Срок действия этой ссылки не истекает . по умолчанию там 60 минут, после этого ссылка должен уничтожатся . Но этого не происходит. ниже мой код буду благодарен любой помощи.
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class mytelresetpassword extends Notification
{
use Queueable;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct($token)
{
//
$this->token = $token;
}
/**
* The callback that should be used to build the mail message.
*
* @var \Closure|null
*/
public static $toMailCallback;
/**
* 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)
{
if (static::$toMailCallback) {
return call_user_func(static::$toMailCallback, $notifiable, $this->token);
}
$time = ['count' => config('auth.passwords.'.config('auth.defaults.passwords').'.expire')];
$time = $time['count'];
return (new MailMessage)
->subject('Şifrənin Dəyişdirilməsi')
->line('Hesabınızdan şifrə yeniləmə tələbi aldığımız üçün bu mail sizə göndərilib.')
->action('Şifrəni Yenilə', url(config('app.url').route('password.reset', ['token' => $this->token, 'email' => $notifiable->getEmailForPasswordReset()], false)))
->line('Bu link '.$time.' dəqiqə müddətində keçərlidir, bu müddət bitdikdən sonra deaktiv olunacaq!')
->line('Şifrə dəyişməyi tələb etməmişsinizsə, "Şifrəni Yenilə" düyməsini klikləməyə ehtiyac yoxdur.');
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
//
];
}
/**
* Set a callback that should be used when building the notification mail message.
*
* @param \Closure $callback
* @return void
*/
public static function toMailUsing($callback)
{
static::$toMailCallback = $callback;
}
}
app\user
public function sendPasswordResetNotification($token)
{
$this->notify(new mytelresetpassword($token));
}
expire
в файлеconfig/auth.php
.php artisan config:cache
? ru.stackoverflow.com/q/797379/256824php artisan config:cache
и на той ссылке нету ответа на мой вопрос((expire
одну минуту, очистите кэшphp artisan config:clear
, попробуйте через минуту сбросить пароль: под полем мыла на втором экране будет ошибка после той страницы, на которую вы из почты перешли.