php artisan make:authでパスワードをリセットしました。Laravel5.3のパスワードリセットリンクを変更するには?
私はこのようなリンクを生成$ actionUrl
という変数にパスワードリセットのリンクを知っています。
http://example.com/program/password/reset/73d9b7b71a1782476dcd12fa438b839fc0a8aed1b7bfe1fad7d5c6909e45c11b
私がしたいことは、このようなリンクを変更することです。
http://example.com/program/admin/password/reset/73d9b7b71a1782476dcd12fa438b839fc0a8aed1b7bfe1fad7d5c6909e45c11b
リンクはhref +トークンで構成されていると思います。 私はカスタムリンクを作ろうとしますが、それは間違った作業です。
アプリ/ User.php - ベンダービューから自分のビューに変更しメール本文
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use App\Notifications\CustomPasswordReset;
class User extends Authenticatable
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
public function sendPasswordResetNotification($token)
{
$this->notify(new CustomPasswordReset($token));
}
}
アプリ/ Notificantions/CustomPasswordReset.php - ボディ
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class CustomPasswordReset extends Notification
{
use Queueable;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* 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)
{
return (new MailMessage)->view('admin.emails.password');
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
//
];
}
}
リソースを電子メールで送信するために独自のビューを表示/views/admin/emails/password.blade.php
<a href="{{ url('/admin/password/reset', csrf_token()) }}">{{ url('/admin/password/reset', csrf_token()) }}</a>
どこを変更すればよいですか?